aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert2019-03-10 23:03:48 -0700
committerPaul Eggert2019-03-10 23:05:30 -0700
commite2f35443796d423ea5f96a99da425a927327deb2 (patch)
tree2ca4cce0736f937dcc60881686500bb4c752a034 /lib
parent89082c823c738b8e3b436e4af1307eefe193eac9 (diff)
downloademacs-e2f35443796d423ea5f96a99da425a927327deb2.tar.gz
emacs-e2f35443796d423ea5f96a99da425a927327deb2.zip
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')
-rw-r--r--lib/alloca.in.h6
-rw-r--r--lib/getloadavg.c12
-rw-r--r--lib/gnulib.mk.in3
3 files changed, 14 insertions, 7 deletions
diff --git a/lib/alloca.in.h b/lib/alloca.in.h
index ec81e119a0f..a581d58f834 100644
--- a/lib/alloca.in.h
+++ b/lib/alloca.in.h
@@ -36,6 +36,12 @@
36 36
37#ifndef alloca 37#ifndef alloca
38# ifdef __GNUC__ 38# ifdef __GNUC__
39 /* Some version of mingw have an <alloca.h> that causes trouble when
40 included after 'alloca' gets defined as a macro. As a workaround, include
41 this <alloca.h> first and define 'alloca' as a macro afterwards. */
42# if (defined _WIN32 && ! defined __CYGWIN__) && @HAVE_ALLOCA_H@
43# include_next <alloca.h>
44# endif
39# define alloca __builtin_alloca 45# define alloca __builtin_alloca
40# elif defined _AIX 46# elif defined _AIX
41# define alloca __alloca 47# define alloca __alloca
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)
424 int saved_errno; 424 int saved_errno;
425 425
426 kc = kstat_open (); 426 kc = kstat_open ();
427 if (kc == 0) 427 if (kc == NULL)
428 return -1; 428 return -1;
429 ksp = kstat_lookup (kc, "unix", 0, "system_misc"); 429 ksp = kstat_lookup (kc, "unix", 0, "system_misc");
430 if (ksp == 0) 430 if (ksp == NULL)
431 return -1; 431 return -1;
432 if (kstat_read (kc, ksp, 0) == -1) 432 if (kstat_read (kc, ksp, 0) == -1)
433 return -1; 433 return -1;
434 434
435 435
436 kn = kstat_data_lookup (ksp, "avenrun_1min"); 436 kn = kstat_data_lookup (ksp, "avenrun_1min");
437 if (kn == 0) 437 if (kn == NULL)
438 { 438 {
439 /* Return -1 if no load average information is available. */ 439 /* Return -1 if no load average information is available. */
440 nelem = 0; 440 nelem = 0;
@@ -447,14 +447,14 @@ getloadavg (double loadavg[], int nelem)
447 if (nelem >= 2) 447 if (nelem >= 2)
448 { 448 {
449 kn = kstat_data_lookup (ksp, "avenrun_5min"); 449 kn = kstat_data_lookup (ksp, "avenrun_5min");
450 if (kn != 0) 450 if (kn != NULL)
451 { 451 {
452 loadavg[elem++] = (double) kn->value.ul / FSCALE; 452 loadavg[elem++] = (double) kn->value.ul / FSCALE;
453 453
454 if (nelem >= 3) 454 if (nelem >= 3)
455 { 455 {
456 kn = kstat_data_lookup (ksp, "avenrun_15min"); 456 kn = kstat_data_lookup (ksp, "avenrun_15min");
457 if (kn != 0) 457 if (kn != NULL)
458 loadavg[elem++] = (double) kn->value.ul / FSCALE; 458 loadavg[elem++] = (double) kn->value.ul / FSCALE;
459 } 459 }
460 } 460 }
@@ -895,7 +895,7 @@ getloadavg (double loadavg[], int nelem)
895 /* We pass 0 for the kernel, corefile, and swapfile names 895 /* We pass 0 for the kernel, corefile, and swapfile names
896 to use the currently running kernel. */ 896 to use the currently running kernel. */
897 kd = kvm_open (0, 0, 0, O_RDONLY, 0); 897 kd = kvm_open (0, 0, 0, O_RDONLY, 0);
898 if (kd != 0) 898 if (kd != NULL)
899 { 899 {
900 /* nlist the currently running kernel. */ 900 /* nlist the currently running kernel. */
901 kvm_nlist (kd, name_list); 901 kvm_nlist (kd, name_list);
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index d8e51ad403b..0d9a885be3d 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -479,6 +479,7 @@ GTK_CFLAGS = @GTK_CFLAGS@
479GTK_LIBS = @GTK_LIBS@ 479GTK_LIBS = @GTK_LIBS@
480GTK_OBJ = @GTK_OBJ@ 480GTK_OBJ = @GTK_OBJ@
481GZIP_PROG = @GZIP_PROG@ 481GZIP_PROG = @GZIP_PROG@
482HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
482HAVE_ALPHASORT = @HAVE_ALPHASORT@ 483HAVE_ALPHASORT = @HAVE_ALPHASORT@
483HAVE_ATOLL = @HAVE_ATOLL@ 484HAVE_ATOLL = @HAVE_ATOLL@
484HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ 485HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@
@@ -1149,7 +1150,7 @@ ifneq (,$(GL_GENERATE_ALLOCA_H))
1149alloca.h: alloca.in.h $(top_builddir)/config.status 1150alloca.h: alloca.in.h $(top_builddir)/config.status
1150 $(AM_V_GEN)rm -f $@-t $@ && \ 1151 $(AM_V_GEN)rm -f $@-t $@ && \
1151 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ 1152 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
1152 cat $(srcdir)/alloca.in.h; \ 1153 sed -e 's|@''HAVE_ALLOCA_H''@|$(HAVE_ALLOCA_H)|g' < $(srcdir)/alloca.in.h; \
1153 } > $@-t && \ 1154 } > $@-t && \
1154 mv -f $@-t $@ 1155 mv -f $@-t $@
1155else 1156else