Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/ipcs The last argument to sysctl() is a size_t, don'...



details:   https://anonhg.NetBSD.org/src/rev/b766ad8ccd01
branches:  trunk
changeset: 553753:b766ad8ccd01
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Tue Oct 21 02:20:22 2003 +0000

description:
The last argument to sysctl() is a size_t, don't pass NULL in it.

diffstat:

 usr.bin/ipcs/ipcs.c |  20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (90 lines):

diff -r 72d118c2c150 -r b766ad8ccd01 usr.bin/ipcs/ipcs.c
--- a/usr.bin/ipcs/ipcs.c       Tue Oct 21 02:19:38 2003 +0000
+++ b/usr.bin/ipcs/ipcs.c       Tue Oct 21 02:20:22 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipcs.c,v 1.30 2003/07/12 13:29:15 itojun Exp $ */
+/*     $NetBSD: ipcs.c,v 1.31 2003/10/21 02:20:22 fvdl Exp $   */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -452,7 +452,7 @@
        mib[0] = CTL_KERN;
        mib[1] = KERN_SYSVMSG;
        len = sizeof(valid);
-       if (sysctl(mib, 2, &valid, &len, NULL, NULL) < 0) {
+       if (sysctl(mib, 2, &valid, &len, NULL, 0) < 0) {
                perror("sysctl(KERN_SYSVMSG)");
                return;
        }
@@ -470,7 +470,7 @@
                /* totals only */
                len = sizeof(struct msginfo);
        } else {
-               if (sysctl(mib, 3, NULL, &len, NULL, NULL) < 0) {
+               if (sysctl(mib, 3, NULL, &len, NULL, 0) < 0) {
                        perror("sysctl(KERN_SYSVIPC_MSG_INFO)");
                        return;
                }
@@ -479,7 +479,7 @@
        if ((buf = malloc(len)) == NULL)
                err(1, "malloc");
        msgsi = (struct msg_sysctl_info *)buf;
-       if (sysctl(mib, 3, msgsi, &len, NULL, NULL) < 0) {
+       if (sysctl(mib, 3, msgsi, &len, NULL, 0) < 0) {
                perror("sysctl(KERN_SYSVIPC_MSG_INFO)");
                return;
        }
@@ -525,7 +525,7 @@
        mib[0] = CTL_KERN;
        mib[1] = KERN_SYSVSHM;
        len = sizeof(valid);
-       if (sysctl(mib, 2, &valid, &len, NULL, NULL) < 0) {
+       if (sysctl(mib, 2, &valid, &len, NULL, 0) < 0) {
                perror("sysctl(KERN_SYSVSHM)");
                return;
        }
@@ -543,7 +543,7 @@
                /* totals only */
                len = sizeof(struct shminfo);
        } else {
-               if (sysctl(mib, 3, NULL, &len, NULL, NULL) < 0) {
+               if (sysctl(mib, 3, NULL, &len, NULL, 0) < 0) {
                        perror("sysctl(KERN_SYSVIPC_SHM_INFO)");
                        return;
                }
@@ -552,7 +552,7 @@
        if ((buf = malloc(len)) == NULL)
                err(1, "malloc");
        shmsi = (struct shm_sysctl_info *)buf;
-       if (sysctl(mib, 3, shmsi, &len, NULL, NULL) < 0) {
+       if (sysctl(mib, 3, shmsi, &len, NULL, 0) < 0) {
                perror("sysctl(KERN_SYSVIPC_SHM_INFO)");
                return;
        }
@@ -596,7 +596,7 @@
        mib[0] = CTL_KERN;
        mib[1] = KERN_SYSVSEM;
        len = sizeof(valid);
-       if (sysctl(mib, 2, &valid, &len, NULL, NULL) < 0) {
+       if (sysctl(mib, 2, &valid, &len, NULL, 0) < 0) {
                perror("sysctl(KERN_SYSVSEM)");
                return;
        }
@@ -614,7 +614,7 @@
                /* totals only */
                len = sizeof(struct seminfo);
        } else {
-               if (sysctl(mib, 3, NULL, &len, NULL, NULL) < 0) {
+               if (sysctl(mib, 3, NULL, &len, NULL, 0) < 0) {
                        perror("sysctl(KERN_SYSVIPC_SEM_INFO)");
                        return;
                }
@@ -623,7 +623,7 @@
        if ((buf = malloc(len)) == NULL)
                err(1, "malloc");
        semsi = (struct sem_sysctl_info *)buf;
-       if (sysctl(mib, 3, semsi, &len, NULL, NULL) < 0) {
+       if (sysctl(mib, 3, semsi, &len, NULL, 0) < 0) {
                perror("sysctl(KERN_SYSVIPC_SEM_INFO)");
                return;
        }



Home | Main Index | Thread Index | Old Index