]> git.ipfire.org Git - thirdparty/fcron.git/commitdiff
Update autoconf to 2.71.
authorThibault Godouet <yo8192@users.noreply.github.com>
Thu, 26 Dec 2024 10:25:13 +0000 (10:25 +0000)
committerThibault Godouet <yo8192@users.noreply.github.com>
Thu, 26 Dec 2024 10:25:13 +0000 (10:25 +0000)
As part of this, switch from the deprecated wait3() to waitpid().

config.h.in
configure.in
database.c
fcron.c
fcrondyn.c
global.h
job.c

index 7a03ef1a53396879320eefb8de3eaf5af4537af3..e2e0985ab8daf4145fe4ee96100175ba95e9d7e0 100644 (file)
 /* Define to `int' if <sys/types.h> doesn't define.  */
 #undef uid_t
 
-/* Define as the return type of signal handlers (int or void).  */
-#undef RETSIGTYPE
-
 /* Define if your struct nlist has an n_un member.  */
 #undef NLIST_NAME_UNION
 
 /* Define if you have the strftime function.  */
 #undef HAVE_STRFTIME
 
-/* Define if you have the wait3 system call.  */
-#undef HAVE_WAIT3
-
 /* ****************************************************************** */
 /* *** Headers *** */
 
index a03d7fc626d4105d91a38df013ff612bce9007fb..60854cd079120fb159e358129ef2e106e1d88715 100644 (file)
@@ -5,9 +5,10 @@ dnl ---------------------------------------------------------------------
 dnl Initial settings
 dnl ---------------------------------------------------------------------
 
-AC_INIT(allow.c)
-AC_CONFIG_HEADER(config.h)
-AC_PREREQ(2.57)
+AC_INIT
+AC_CONFIG_SRCDIR([allow.c])
+AC_CONFIG_HEADERS([config.h])
+AC_PREREQ([2.71])
 m4_include([m4/ax_lib_readline.m4])
 
 vers="3.3.2"
@@ -48,7 +49,6 @@ dnl Checks for libraries.
 dnl Checks for header files.
 AC_HEADER_DIRENT
 AC_HEADER_STDBOOL
-AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(fcntl.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h)
 AC_CHECK_HEADERS(errno.h sys/fcntl.h getopt.h limits.h)
@@ -64,7 +64,8 @@ dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_TYPE_PID_T
 AC_TYPE_SIZE_T
-AC_HEADER_TIME
+AC_CHECK_HEADERS_ONCE([sys/time.h])
+
 AC_STRUCT_TM
 AC_TYPE_UID_T
 
@@ -83,9 +84,7 @@ AC_CHECK_SIZEOF(long long int)
 dnl Checks for library functions.
 AC_PROG_GCC_TRADITIONAL
 AC_FUNC_MEMCMP
-AC_TYPE_SIGNAL
 AC_FUNC_STRFTIME
-AC_FUNC_WAIT3
 AC_CHECK_LIB(xnet, shutdown)
 AC_CHECK_LIB(selinux, getcon, [selinuxavail=1], [selinuxavail=0])
 AC_CHECK_LIB(audit, audit_open, [auditavail=1], [auditavail=0])
@@ -148,10 +147,9 @@ dnl --- sockets
 dnl Check for post-Reno style struct sockaddr
 AC_CACHE_CHECK([for sa_len],
   ac_cv_sa_len,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/socket.h>], [int main(void) {
- struct sockaddr t;t.sa_len = 0;}],
-  ac_cv_sa_len=yes,ac_cv_sa_len=no)])
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <sys/socket.h>]], [[int main(void) {
+ struct sockaddr t;t.sa_len = 0;}]])],[ac_cv_sa_len=yes],[ac_cv_sa_len=no])])
 if test $ac_cv_sa_len = yes; then
   AC_DEFINE(HAVE_SA_LEN)
 fi
@@ -1076,7 +1074,8 @@ dnl Final settings
 dnl ---------------------------------------------------------------------
 
 
-AC_OUTPUT(Makefile doc/Makefile test/Makefile doc/stylesheets/fcron-doc.dsl)
+AC_CONFIG_FILES([Makefile doc/Makefile test/Makefile doc/stylesheets/fcron-doc.dsl])
+AC_OUTPUT
 
 
 dnl ---------------------------------------------------------------------
index 2e7d67d1abfb17cac6de3607cf19b5098fb2955f..c27553620f6b9b802023eb9bfefde461644cf9a5 100644 (file)
@@ -532,7 +532,7 @@ wait_chld(void)
 /*      debug("wait_chld"); */
 /*      // */
 
-    while ((pid = wait3(NULL, WNOHANG, NULL)) > 0) {
+    while ((pid = waitpid(-1, NULL, WNOHANG)) > 0) {
 
         for (e = exe_list_first(exe_list); e != NULL;
              e = exe_list_next(exe_list)) {
@@ -584,7 +584,7 @@ wait_all(int *counter)
 
     debug("Waiting for all jobs");
 
-    while ((*counter > 0) && (pid = wait3(NULL, 0, NULL)) > 0) {
+    while ((*counter > 0) && (pid = waitpid(-1, NULL, 0)) > 0) {
         for (e = exe_list_first(exe_list); e != NULL;
              e = exe_list_next(exe_list)) {
             if (pid == e->e_ctrl_pid) {
diff --git a/fcron.c b/fcron.c
index 2133b9ea30143dd486f8344f18bf7abe0df519f5..1b2fdb7b386fa28b7a7a9e12b4f1572022fb988d 100644 (file)
--- a/fcron.c
+++ b/fcron.c
@@ -42,12 +42,12 @@ void reset_sig_cont(void);
 void info(void);
 void usage(void);
 void print_schedule(void);
-RETSIGTYPE sighup_handler(int x);
-RETSIGTYPE sigterm_handler(int x);
-RETSIGTYPE sigchild_handler(int x);
-RETSIGTYPE sigusr1_handler(int x);
-RETSIGTYPE sigusr2_handler(int x);
-RETSIGTYPE sigcont_handler(int x);
+void sighup_handler(int x);
+void sigterm_handler(int x);
+void sigchild_handler(int x);
+void sigusr1_handler(int x);
+void sigusr2_handler(int x);
+void sigcont_handler(int x);
 int parseopt(int argc, char *argv[]);
 void get_lock(void);
 int is_system_reboot(void);
@@ -476,7 +476,7 @@ create_spooldir(char *dir)
 }
 
 
-RETSIGTYPE
+void
 sigterm_handler(int x)
   /* exit safely */
 {
@@ -485,7 +485,7 @@ sigterm_handler(int x)
     xexit(EXIT_OK);
 }
 
-RETSIGTYPE
+void
 sighup_handler(int x)
   /* update configuration */
 {
@@ -496,7 +496,7 @@ sighup_handler(int x)
     sig_conf = 1;
 }
 
-RETSIGTYPE
+void
 sigchild_handler(int x)
   /* call wait_chld() to take care of finished jobs */
 {
@@ -506,7 +506,7 @@ sigchild_handler(int x)
 }
 
 
-RETSIGTYPE
+void
 sigusr1_handler(int x)
   /* reload all configurations */
 {
@@ -518,14 +518,14 @@ sigusr1_handler(int x)
 }
 
 
-RETSIGTYPE
+void
 sigusr2_handler(int x)
   /* print schedule and switch on/off debug mode */
 {
     sig_debug = 1;
 }
 
-RETSIGTYPE
+void
 sigcont_handler(int x)
   /* used to notify fcron of a system resume after suspend.
    * However this signal could also be received in other cases. */
index e44e0ff9c1488d3541824b79bd006d7b4f517593..e18a009255c98af2355aaae5689b95420fbbdfb2 100644 (file)
@@ -52,7 +52,7 @@ char *rl_cmpl_command_generator(const char *text, int state);
 void info(void);
 void usage(void);
 void xexit(int exit_val);
-RETSIGTYPE sigpipe_handler(int x);
+void sigpipe_handler(int x);
 int interactive_mode(int fd);
 /* returned by parse_cmd() and/or talk_fcron() */
 #define QUIT_CMD 1
@@ -148,7 +148,7 @@ usage(void)
     exit(EXIT_ERR);
 }
 
-RETSIGTYPE
+void
 sigpipe_handler(int x)
     /* handle broken pipes ... */
 {
index d2c0f2c02c4a3fc7117f2c5c70953d506f557d10..9cd0e6cf7c72ceac39648ed492884eaefade807b 100644 (file)
--- a/global.h
+++ b/global.h
@@ -99,9 +99,8 @@
 #include <syslog.h>
 #endif
 
-#ifdef TIME_WITH_SYS_TIME
 #include <time.h>
-#elif HAVE_SYS_TIME_H
+#if HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
 
diff --git a/job.c b/job.c
index 9afddfad50da7d376da9dcf5368fa5737c3ba6db..f814a519061439e098155296b093eb43f4d9983e 100644 (file)
--- a/job.c
+++ b/job.c
@@ -728,7 +728,7 @@ run_job(struct exe_t *exeent)
                 xclose_check(&(pipe_pid_fd[1]), "child's pipe_pid_fd[1]");
 
                 /* we use a while because of a possible interruption by a signal */
-                while ((pid = wait3(&status, 0, NULL)) > 0) {
+                while ((pid = waitpid(-1, &status, 0)) > 0) {
 #ifdef CHECKRUNJOB
                     debug("run_job(): child: ending job pid %d", pid);
 #endif                          /* CHECKRUNJOB */