summaryrefslogtreecommitdiff
path: root/lib/getloadavg.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-03-10 23:03:48 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2019-03-10 23:05:30 -0700
commite2f35443796d423ea5f96a99da425a927327deb2 (patch)
tree2ca4cce0736f937dcc60881686500bb4c752a034 /lib/getloadavg.c
parent89082c823c738b8e3b436e4af1307eefe193eac9 (diff)
downloademacs-e2f35443796d423ea5f96a99da425a927327deb2.tar.gz
Update from Gnulib
This incorporates: 2019-03-10 alloca-opt: Fix conflict mingw's new <alloca.h> file 2019-03-03 getloadavg: Write NULL for the null pointer Reported by Michal Privoznik <mprivozn@redhat.com>. * lib/getloadavg.c (getloadavg): Write NULL instead of 0. * build-aux/config.guess, build-aux/move-if-change: * doc/misc/texinfo.tex, lib/alloca.in.h, lib/getloadavg.c: * m4/alloca.m4: Copy from Gnulib. * lib/gnulib.mk.in: Regenerate.
Diffstat (limited to 'lib/getloadavg.c')
-rw-r--r--lib/getloadavg.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/getloadavg.c b/lib/getloadavg.c
index 353664777fb..08c14efcfce 100644
--- a/lib/getloadavg.c
+++ b/lib/getloadavg.c
@@ -424,17 +424,17 @@ getloadavg (double loadavg[], int nelem)
int saved_errno;
kc = kstat_open ();
- if (kc == 0)
+ if (kc == NULL)
return -1;
ksp = kstat_lookup (kc, "unix", 0, "system_misc");
- if (ksp == 0)
+ if (ksp == NULL)
return -1;
if (kstat_read (kc, ksp, 0) == -1)
return -1;
kn = kstat_data_lookup (ksp, "avenrun_1min");
- if (kn == 0)
+ if (kn == NULL)
{
/* Return -1 if no load average information is available. */
nelem = 0;
@@ -447,14 +447,14 @@ getloadavg (double loadavg[], int nelem)
if (nelem >= 2)
{
kn = kstat_data_lookup (ksp, "avenrun_5min");
- if (kn != 0)
+ if (kn != NULL)
{
loadavg[elem++] = (double) kn->value.ul / FSCALE;
if (nelem >= 3)
{
kn = kstat_data_lookup (ksp, "avenrun_15min");
- if (kn != 0)
+ if (kn != NULL)
loadavg[elem++] = (double) kn->value.ul / FSCALE;
}
}
@@ -895,7 +895,7 @@ getloadavg (double loadavg[], int nelem)
/* We pass 0 for the kernel, corefile, and swapfile names
to use the currently running kernel. */
kd = kvm_open (0, 0, 0, O_RDONLY, 0);
- if (kd != 0)
+ if (kd != NULL)
{
/* nlist the currently running kernel. */
kvm_nlist (kd, name_list);