at/at-3.1.13-massive_batch.patch
Kristyna Streitova 658a744b4d Accepting request 512270 from home:scarabeus_iv:branches:Base:System
- Drop patch at-3.1.8-eal3-manpages.patch merged upstream differently

- Version update to at 3.1.20 to match latest upstream:
  * Pam and selinux implemented upstream
  * various tiny fixes
- Rebase patches:
  * at-3.1.13-documentation-dir.patch
  * at-3.1.13-massive_batch.patch
  * at-3.1.14-joblist.patch
  * at-3.1.14-parse-suse-sysconfig.patch
  * at-3.1.14-usePOSIXtimers.patch
  * at-3.1.14.patch
- Drop no longer needed patches:
  * at-3.1.13-formatbugs.patch
  * at-3.1.13-pam-session-as-root.patch
  * at-3.1.13-pam.patch
  * at-3.1.13-queue-nice-level.patch
  * at-3.1.14-selinux.patch

OBS-URL: https://build.opensuse.org/request/show/512270
OBS-URL: https://build.opensuse.org/package/show/Base:System/at?expand=0&rev=102
2017-07-27 14:14:04 +00:00

60 lines
1.3 KiB
Diff

Index: atd.c
===================================================================
--- atd.c.orig
+++ atd.c
@@ -108,9 +108,10 @@ static char *namep;
static double load_avg = LOADAVG_MX;
static time_t now;
static time_t last_chg;
-static int nothing_to_do;
+static int nothing_to_do = 0;
unsigned int batch_interval;
static int run_as_daemon = 0;
+static int hupped = 0;
static volatile sig_atomic_t term_signal = 0;
@@ -141,10 +142,10 @@ set_term(int dummy)
return;
}
-RETSIGTYPE
-sdummy(int dummy)
+RETSIGTYPE
+set_hup(int dummy)
{
- /* Empty signal handler */
+ hupped = 1;
nothing_to_do = 0;
return;
}
@@ -647,6 +648,7 @@ run_loop()
return next_job;
last_chg = buf.st_mtime;
+ hupped = 0;
if ((spool = opendir(".")) == NULL)
perr("Cannot read " ATJOB_DIR);
@@ -898,7 +900,7 @@ main(int argc, char *argv[])
*/
sigaction(SIGHUP, NULL, &act);
- act.sa_handler = sdummy;
+ act.sa_handler = set_hup;
sigaction(SIGHUP, &act, NULL);
sigaction(SIGTERM, NULL, &act);
@@ -914,9 +916,10 @@ main(int argc, char *argv[])
do {
now = time(NULL);
next_invocation = run_loop();
- if (next_invocation > now) {
+ if ((next_invocation > now) && (!hupped)) {
sleep(next_invocation - now);
}
+ hupped = 0;
} while (!term_signal);
daemon_cleanup();
exit(EXIT_SUCCESS);