From: Thibault Godouet Date: Thu, 26 Dec 2024 10:25:13 +0000 (+0000) Subject: Update autoconf to 2.71. X-Git-Tag: ver3_3_2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5f8228478d97d2056c6718c09bb918ebfd688857;p=thirdparty%2Ffcron.git Update autoconf to 2.71. As part of this, switch from the deprecated wait3() to waitpid(). --- diff --git a/config.h.in b/config.h.in index 7a03ef1..e2e0985 100644 --- a/config.h.in +++ b/config.h.in @@ -215,9 +215,6 @@ /* Define to `int' if 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 @@ -321,9 +318,6 @@ /* Define if you have the strftime function. */ #undef HAVE_STRFTIME -/* Define if you have the wait3 system call. */ -#undef HAVE_WAIT3 - /* ****************************************************************** */ /* *** Headers *** */ diff --git a/configure.in b/configure.in index a03d7fc..60854cd 100644 --- a/configure.in +++ b/configure.in @@ -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 -#include ], [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 +#include ]], [[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 --------------------------------------------------------------------- diff --git a/database.c b/database.c index 2e7d67d..c275536 100644 --- a/database.c +++ b/database.c @@ -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 2133b9e..1b2fdb7 100644 --- 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. */ diff --git a/fcrondyn.c b/fcrondyn.c index e44e0ff..e18a009 100644 --- a/fcrondyn.c +++ b/fcrondyn.c @@ -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 ... */ { diff --git a/global.h b/global.h index d2c0f2c..9cd0e6c 100644 --- a/global.h +++ b/global.h @@ -99,9 +99,8 @@ #include #endif -#ifdef TIME_WITH_SYS_TIME #include -#elif HAVE_SYS_TIME_H +#if HAVE_SYS_TIME_H #include #endif diff --git a/job.c b/job.c index 9afddfa..f814a51 100644 --- 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 */