From: Francois-Xavier Le Bail Date: Tue, 18 Aug 2015 18:59:31 +0000 (+0200) Subject: Fix a warning as "ISO C90 forbids mixed declarations and code" X-Git-Tag: tcpdump-4.8.0~192 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/e64eab6f72b4e2f3b77b17a679805c519647ecbe?ds=inline Fix a warning as "ISO C90 forbids mixed declarations and code" The warning was: ./tcpdump.c: In function 'droproot': ./tcpdump.c:496:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] int ret = capng_change_id(pw->pw_uid, pw->pw_gid, CAPNG_NO_FLAG); ^ --- diff --git a/tcpdump.c b/tcpdump.c index 2b7dfa97..207908a5 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -493,12 +493,13 @@ droproot(const char *username, const char *chroot_dir) } } #ifdef HAVE_LIBCAP_NG - int ret = capng_change_id(pw->pw_uid, pw->pw_gid, CAPNG_NO_FLAG); - if (ret < 0) { - fprintf(stderr, "error : ret %d\n", ret); - } - else { - fprintf(stderr, "dropped privs to %s\n", username); + { + int ret = capng_change_id(pw->pw_uid, pw->pw_gid, CAPNG_NO_FLAG); + if (ret < 0) { + fprintf(stderr, "error : ret %d\n", ret); + } else { + fprintf(stderr, "dropped privs to %s\n", username); + } } #else if (initgroups(pw->pw_name, pw->pw_gid) != 0 ||