Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/usr.bin/pkill Pull up following revision(s) (requested by...



details:   https://anonhg.NetBSD.org/src/rev/5fb0a11713b8
branches:  netbsd-3
changeset: 577357:5fb0a11713b8
user:      riz <riz%NetBSD.org@localhost>
date:      Sat Oct 15 16:33:15 2005 +0000

description:
Pull up following revision(s) (requested by kleink in ticket #890):
        usr.bin/pkill/pkill.c: revision 1.12
Fix more lint problems.

diffstat:

 usr.bin/pkill/pkill.c |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (71 lines):

diff -r 49739a6c7991 -r 5fb0a11713b8 usr.bin/pkill/pkill.c
--- a/usr.bin/pkill/pkill.c     Sat Oct 15 16:32:20 2005 +0000
+++ b/usr.bin/pkill/pkill.c     Sat Oct 15 16:33:15 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pkill.c,v 1.9.2.2 2005/10/15 16:32:20 riz Exp $        */
+/*     $NetBSD: pkill.c,v 1.9.2.3 2005/10/15 16:33:15 riz Exp $        */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: pkill.c,v 1.9.2.2 2005/10/15 16:32:20 riz Exp $");
+__RCSID("$NetBSD: pkill.c,v 1.9.2.3 2005/10/15 16:33:15 riz Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -244,7 +244,7 @@
         * Allocate memory which will be used to keep track of the
         * selection.
         */
-       if ((selected = calloc(1, nproc)) == NULL)
+       if ((selected = calloc((size_t)1, (size_t)nproc)) == NULL)
                err(STATUS_ERROR, "Cannot allocate memory for %d processes",
                    nproc);
 
@@ -253,7 +253,7 @@
         */
        for (; *argv != NULL; argv++) {
                if ((rv = regcomp(&reg, *argv, cflags)) != 0) {
-                       regerror(rv, &reg, buf, sizeof(buf));
+                       (void)regerror(rv, &reg, buf, sizeof(buf));
                        errx(STATUS_BADUSAGE,
                            "Cannot compile regular expression `%s' (%s)",
                            *argv, buf);
@@ -288,7 +288,7 @@
                                } else
                                        selected[i] = 1;
                        } else if (rv != REG_NOMATCH) {
-                               regerror(rv, &reg, buf, sizeof(buf));
+                               (void)regerror(rv, &reg, buf, sizeof(buf));
                                errx(STATUS_ERROR,
                                    "Regular expression evaluation error (%s)",
                                    buf);
@@ -384,7 +384,7 @@
                        }
                }
 
-               (void)memset(selected, 0, nproc);
+               (void)memset(selected, 0, (size_t)nproc);
                if (bestidx != -1)
                        selected[bestidx] = 1;
        }
@@ -407,7 +407,7 @@
                rv |= (*action)(kp);
        }
 
-       exit(rv ? STATUS_MATCH : STATUS_NOMATCH);
+       return rv ? STATUS_MATCH : STATUS_NOMATCH;
 }
 
 static void
@@ -514,6 +514,7 @@
                                break;
                        case LT_TTY:
                                usage();
+                               /*NOTREACHED*/
                        default:
                                break;
                        }



Home | Main Index | Thread Index | Old Index