diff options
author | Rob Landley <rob@landley.net> | 2015-01-16 13:43:09 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2015-01-16 13:43:09 -0600 |
commit | 3b915991f8c8648f939498777f4d76aad04f2817 (patch) | |
tree | 2a2c6ea74b5a6b37e13e0ce27c69a98f95a2e51e /toys/posix | |
parent | 7e2af1c7489cbf974a57d482bb9d23c884d2aa49 (diff) | |
download | toybox-3b915991f8c8648f939498777f4d76aad04f2817.tar.gz |
id.c #ifdefectomy. (ifdefs belong in headers, not in C code.)
Diffstat (limited to 'toys/posix')
-rw-r--r-- | toys/posix/id.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/toys/posix/id.c b/toys/posix/id.c index 4e1ec8cb..353aa041 100644 --- a/toys/posix/id.c +++ b/toys/posix/id.c @@ -146,17 +146,18 @@ void do_id(char *username) } } -#if CFG_TOYBOX_SELINUX - char *context = NULL; - if (is_selinux_enabled() < 1) { - if (TT.do_Z) - error_exit("SELinux disabled"); - } else if (getcon(&context) == 0) { - if (!TT.do_Z) xputc(' '); - printf("context=%s", context); + if (CFG_TOYBOX_SELINUX) { + char *context = NULL; + + if (is_selinux_enabled() < 1) { + if (TT.do_Z) + error_exit("SELinux disabled"); + } else if (getcon(&context) == 0) { + if (!TT.do_Z) xputc(' '); + printf("context=%s", context); + } + if (CFG_TOYBOX_FREE) free(context); } - if (CFG_TOYBOX_FREE) free(context); -#endif xputc('\n'); } |