From: Tobias Oetiker Date: Mon, 12 Jan 2015 20:37:33 +0000 (+0100) Subject: check if we have sigwaitinfo and use sigwait instead ... X-Git-Tag: v1.5.0-rc2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf37a47ce965c401f1f9693cfcdc8d7baac443a8;p=thirdparty%2Frrdtool-1.x.git check if we have sigwaitinfo and use sigwait instead ... --- diff --git a/configure b/configure index eea625e5..938b81d8 100755 --- a/configure +++ b/configure @@ -14726,7 +14726,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h -for ac_func in nl_langinfo tzset fsync mbstowcs opendir readdir chdir chroot getgid getuid setgid setuid strndup strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday getpwnam getgrnam +for ac_func in sigwait sigwaitinfo nl_langinfo tzset fsync mbstowcs opendir readdir chdir chroot getgid getuid setgid setuid strndup strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday getpwnam getgrnam do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/configure.ac b/configure.ac index 9439b3ec..9db5f59d 100644 --- a/configure.ac +++ b/configure.ac @@ -251,7 +251,7 @@ AC_C_BIGENDIAN dnl for each function found we get a definition in config.h dnl of the form HAVE_FUNCTION -AC_CHECK_FUNCS(nl_langinfo tzset fsync mbstowcs opendir readdir chdir chroot getgid getuid setgid setuid strndup strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday getpwnam getgrnam) +AC_CHECK_FUNCS(sigwait sigwaitinfo nl_langinfo tzset fsync mbstowcs opendir readdir chdir chroot getgid getuid setgid setuid strndup strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday getpwnam getgrnam) AC_FUNC_STRERROR_R diff --git a/doc/Makefile.in b/doc/Makefile.in index 5729e0c7..3c6acc6e 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -363,7 +363,7 @@ POD = bin_dec_hex.pod rrddump.pod rrdgraph_examples.pod rrdrestore.pod \ rrdinfo.pod rrdtune.pod rrdbuild.pod rrdflushcached.pod \ rrdcgi.pod rrdgraph.pod rrdlast.pod rrdlastupdate.pod \ rrdcreate.pod rrdgraph_data.pod rrdresize.pod rrdtutorial.pod \ - rrdmodify.pod $(am__append_1) $(am__append_2) + $(am__append_1) $(am__append_2) POD3 = librrd.pod PMP = RRDs.pod RRDp.pod MAN = $(POD:.pod=.1) diff --git a/src/rrd_config.h.in b/src/rrd_config.h.in index 25fae142..d02f7606 100644 --- a/src/rrd_config.h.in +++ b/src/rrd_config.h.in @@ -288,6 +288,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H +/* Define to 1 if you have the `sigwait' function. */ +#undef HAVE_SIGWAIT + +/* Define to 1 if you have the `sigwaitinfo' function. */ +#undef HAVE_SIGWAITINFO + /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c index 5eb4c774..94d9c890 100644 --- a/src/rrd_daemon.c +++ b/src/rrd_daemon.c @@ -340,8 +340,14 @@ static void* signal_receiver (void UNUSED(*args)) while (1) { +#if HAVE_SIGWAITINFO status = sigwaitinfo(&signal_set, &signal_info); - +#else + status = -1; + if (sigwait(set, &status) < 0 ){ + status = -1; + } +#endif switch(status) { case -1: