diff options
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | utils/nhfsstone/nhfsstone.c | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/configure.in b/configure.in index 1a1a25d..3f8fbb5 100644 --- a/configure.in +++ b/configure.in @@ -242,7 +242,7 @@ AC_CHECK_FUNCS([alarm atexit dup2 fdatasync ftruncate getcwd \ gethostbyaddr gethostbyname gethostname getmntent \ gettimeofday hasmntopt inet_ntoa innetgr memset mkdir pathconf \ realpath rmdir select socket strcasecmp strchr strdup \ - strerror strrchr strtol strtoul]) + strerror strrchr strtol strtoul sigprocmask]) dnl ************************************************************* diff --git a/utils/nhfsstone/nhfsstone.c b/utils/nhfsstone/nhfsstone.c index 034ba79..ceff966 100644 --- a/utils/nhfsstone/nhfsstone.c +++ b/utils/nhfsstone/nhfsstone.c @@ -10,6 +10,7 @@ static char sccsid[] = "@(#)nhfsstone.c 1.22 90/05/08 Copyright (c) 1990, Legato * Ported to Linux by Olaf Kirch <okir@monad.swb.de> */ +#include "config.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -312,7 +313,11 @@ main(int argc, char **argv) int pid; /* process id */ int delay; /* msecs since last checked current time */ int randnum; /* a random number */ +#if HAVE_SIGPROCMASK + sigset_t oldmask; /* saved signal mask */ +#else int oldmask; /* saved signal mask */ +#endif int sampletime; /* secs between reading kernel stats */ char *opts; /* option parsing */ int pct; @@ -478,7 +483,20 @@ main(int argc, char **argv) (void) signal(SIGINT, cleanup); (void) signal(SIGUSR1, startup); +#if HAVE_SIGPROCMASK + { + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + sigprocmask(SIG_BLOCK, &mask, &oldmask); + } +#else + /* + * sigblock() is marked deprecated in modern + * glibc and hence generates a warning. + */ oldmask = sigblock(sigmask(SIGUSR1)); +#endif if (ncalls == 0) { if (runtime == 0) { @@ -630,7 +648,11 @@ main(int argc, char **argv) exit(1); } +#if HAVE_SIGPROCMASK + sigsuspend(&oldmask); +#else sigpause(oldmask); +#endif /* * Initialize counters |