]> granicus.if.org Git - procps-ng/commitdiff
pgrep: fix compiler warnings
authorSami Kerola <kerolasa@iki.fi>
Sat, 25 Feb 2012 21:09:50 +0000 (22:09 +0100)
committerCraig Small <csmall@enc.com.au>
Sat, 3 Mar 2012 07:29:40 +0000 (18:29 +1100)
pgrep.c:539:10: warning: unused variable 'buff' [-Wunused-variable]
pgrep.c:648:1: warning: "/*" within comment [-Wcomment]
pgrep.c:803:4: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long int' [-Wformat]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Conflicts:

pgrep.c

pgrep.c

diff --git a/pgrep.c b/pgrep.c
index b1d4ace44f60e63a75caff159bd949108ed5e1fc..1618a685f5ce4cae9442fd72d6ecd830fe0c048a 100644 (file)
--- a/pgrep.c
+++ b/pgrep.c
@@ -536,7 +536,6 @@ static struct el * select_procs (int *num)
                                list = xrealloc(list, size * sizeof *list);
                        }
                        if (list && (opt_long || opt_echo)) {
-                               char buff[5096];  /* FIXME */
                                list[matches].num = task.XXXID;
                                list[matches++].str = xstrdup (cmd);
                        } else if (list) {
@@ -644,7 +643,7 @@ static void parse_opts (int argc, char **argv)
                        ++criteria_count;
                        break;
 /*             case 'I':   / * FreeBSD: require confirmation before killing * /
- *                     break;
+ *                     break; */
 /*             case 'J':   / * Solaris: match by project ID (name or number) * /
  *                     break; */
                case 'L':   /* FreeBSD: fail if pidfile (see -F) not locked */
@@ -798,8 +797,8 @@ int main (int argc, char **argv)
                                continue;
                        }
                        if (errno==ESRCH)
-                                // gone now, which is OK
-                               continue;
+                                /* gone now, which is OK */
+                               continue;
                        xwarn(_("killing pid %ld failed"), procs[i].num);
                }
        } else {