diff options
author | Mike Frysinger <vapier@gentoo.org> | 2008-12-30 13:13:15 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2008-12-30 13:13:15 +0000 |
commit | f538ef2a2ab0a189ff2cd75c3014ec2d5e448ead (patch) | |
tree | f3a980e30654f6cae40780e8f3397e12a5c55f6e | |
parent | fixup const handling in getstr_perms() (diff) | |
download | pax-utils-f538ef2a2ab0a189ff2cd75c3014ec2d5e448ead.tar.gz pax-utils-f538ef2a2ab0a189ff2cd75c3014ec2d5e448ead.tar.bz2 pax-utils-f538ef2a2ab0a189ff2cd75c3014ec2d5e448ead.zip |
drop excessive parenthesis
-rw-r--r-- | pspax.c | 21 | ||||
-rw-r--r-- | scanelf.c | 8 | ||||
-rw-r--r-- | scanmacho.c | 6 |
3 files changed, 18 insertions, 17 deletions
@@ -12,7 +12,7 @@ * cc -o pspax pspax.c -DWANT_SYSCAP -lcap */ -static const char *rcsid = "$Id: pspax.c,v 1.41 2008/03/20 19:08:16 solar Exp $"; +static const char *rcsid = "$Id: pspax.c,v 1.42 2008/12/30 13:13:15 vapier Exp $"; const char * const argv0 = "pspax"; #include "paxinc.h" @@ -151,7 +151,7 @@ static struct passwd *get_proc_passwd(pid_t pid) snprintf(str, sizeof(str), PROC_DIR "/%u/stat", pid); - if ((stat(str, &st)) != (-1)) + if (stat(str, &st) != -1) if ((pwd = getpwuid(st.st_uid)) != NULL) return pwd; return NULL; @@ -306,12 +306,12 @@ static void pspax(const char *find_name) exit(EXIT_FAILURE); } - if (access("/proc/self/attr/current", R_OK) != (-1)) + if (access("/proc/self/attr/current", R_OK) != -1) have_attr = 1; else have_attr = 0; - if ((access("/proc/self/ipaddr", R_OK) != (-1)) && show_addr) + if ((access("/proc/self/ipaddr", R_OK) != -1) && show_addr) have_addr = 1; else have_addr = 0; @@ -328,11 +328,12 @@ static void pspax(const char *find_name) pid = (pid_t) atoi((char *) basename((char *) de->d_name)); if (find_name && pid) { char *str = get_proc_name(pid); - if (!str) continue; + if (!str) + continue; if (strcmp(str, find_name) != 0) pid = 0; } - if (((ppid > 0) && (pid != ppid)) || (!pid)) + if (((ppid > 0) && (pid != ppid)) || !pid) continue; wx = get_proc_maps(pid); @@ -341,7 +342,7 @@ static void pspax(const char *find_name) if ((wx == 1) && (writeexec != wx)) goto next_pid; - if ((wx == 0) && (writeexec)) + if ((wx == 0) && writeexec) goto next_pid; } @@ -352,11 +353,11 @@ static void pspax(const char *find_name) attr = (have_attr ? get_pid_attr(pid) : NULL); addr = (have_addr ? get_pid_addr(pid) : NULL); - if (show_uid != (-1) && pwd) + if (show_uid != -1 && pwd) if (pwd->pw_uid != show_uid) continue; - if (show_gid != (-1) && pwd) + if (show_gid != -1 && pwd) if (pwd->pw_gid != show_gid) continue; @@ -383,7 +384,7 @@ static void pspax(const char *find_name) print_executable_mappings(pid); } - WRAP_SYSCAP(if (caps) cap_free((void *)caps)); + WRAP_SYSCAP(if (caps) cap_free(caps)); next_pid: continue; @@ -1,13 +1,13 @@ /* * Copyright 2003-2007 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.204 2008/12/30 13:09:20 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.205 2008/12/30 13:13:15 vapier Exp $ * * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org> * Copyright 2004-2007 Mike Frysinger - <vapier@gentoo.org> */ -static const char *rcsid = "$Id: scanelf.c,v 1.204 2008/12/30 13:09:20 vapier Exp $"; +static const char *rcsid = "$Id: scanelf.c,v 1.205 2008/12/30 13:13:15 vapier Exp $"; const char * const argv0 = "scanelf"; #include "paxinc.h" @@ -105,7 +105,7 @@ static char *which(const char *fname) while ((p = strrchr(path, ':')) != NULL) { snprintf(fullpath, sizeof(fullpath), "%s/%s", p + 1, fname); *p = 0; - if (access(fullpath, R_OK) != (-1)) { + if (access(fullpath, R_OK) != -1) { free(path); return fullpath; } @@ -1762,7 +1762,7 @@ static int parseargs(int argc, char *argv[]) } break; case 'O': - if (sscanf(optarg, "%o", &match_perms) == (-1)) + if (sscanf(optarg, "%o", &match_perms) == -1) match_bits = 0; break; case 'o': { diff --git a/scanmacho.c b/scanmacho.c index cf1b042..d4282fe 100644 --- a/scanmacho.c +++ b/scanmacho.c @@ -1,7 +1,7 @@ /* * Copyright 2008 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanmacho.c,v 1.10 2008/12/30 13:09:20 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanmacho.c,v 1.11 2008/12/30 13:13:15 vapier Exp $ * * based on scanelf by: * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org> @@ -10,7 +10,7 @@ * 2008 Fabian Groffen - <grobian@gentoo.org> */ -static const char *rcsid = "$Id: scanmacho.c,v 1.10 2008/12/30 13:09:20 vapier Exp $"; +static const char *rcsid = "$Id: scanmacho.c,v 1.11 2008/12/30 13:13:15 vapier Exp $"; const char * const argv0 = "scanmacho"; #include "paxinc.h" @@ -644,7 +644,7 @@ static int parseargs(int argc, char *argv[]) match_bits = atoi(optarg); break; case 'O': - if (sscanf(optarg, "%o", &match_perms) == (-1)) + if (sscanf(optarg, "%o", &match_perms) == -1) match_bits = 0; break; case 'o': { |