linker: surround "debug_verbosity" by "#if LINKER_DEBUG"

Avoid executing useless code when we're not compiled
with debugging support.

Change-Id: Iea1821b241acacdf65d1a91d743356058dfef273
This commit is contained in:
Nick Kralevich 2012-04-04 12:43:32 -07:00
parent 3a7ea52f17
commit 8c4f3ce8d0

View File

@ -108,7 +108,10 @@ static const char *ldpreload_names[LDPRELOAD_MAX + 1];
static soinfo *preloads[LDPRELOAD_MAX + 1];
#if LINKER_DEBUG
int debug_verbosity;
#endif
static int pid;
/* This boolean is set if the program being loaded is setuid */
@ -2120,10 +2123,12 @@ sanitize:
/* Get a few environment variables */
{
#if LINKER_DEBUG
const char* env;
env = linker_env_get("DEBUG"); /* XXX: TODO: Change to LD_DEBUG */
if (env)
debug_verbosity = atoi(env);
#endif
/* Normally, these are cleaned by linker_env_secure, but the test
* against program_is_setuid doesn't cost us anything */