From 0d04c87755850593cdb5f67dff6efe253c25a8dd Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Mon, 28 Oct 2013 23:02:21 +0100 Subject: [PATCH] Constify progname --- src/libfaketime.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libfaketime.c b/src/libfaketime.c index 8ac9083..7849212 100644 --- a/src/libfaketime.c +++ b/src/libfaketime.c @@ -1382,7 +1382,13 @@ parse_modifiers: void __attribute__ ((constructor)) ftpl_init(void) { - char *tmp_env, *progname; + char *tmp_env; + +#ifdef __APPLE__ + const char *progname = getprogname(); +#else + const char *progname = __progname; +#endif /* Look up all real_* functions. NULL will mark missing ones. */ real_stat = dlsym(RTLD_NEXT, "__xstat"); @@ -1438,12 +1444,6 @@ void __attribute__ ((constructor)) ftpl_init(void) /* Check whether we actually should be faking the returned timestamp. */ -#ifdef __APPLE__ - progname = getprogname(); -#else - progname = __progname; -#endif - /* We can prevent faking time for specified commands */ if ((tmp_env = getenv("FAKETIME_SKIP_CMDS")) != NULL) { char *skip_cmd, *saveptr;