2022-02-22 16:01:05 +00:00
|
|
|
diff -ur b/atd.c a/atd.c
|
|
|
|
--- b/atd.c 2022-02-22 16:09:15.683717386 +0100
|
|
|
|
+++ a/atd.c 2022-02-22 16:12:48.992989327 +0100
|
|
|
|
@@ -344,9 +344,12 @@
|
2016-03-23 14:24:03 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
pid = fork();
|
|
|
|
- if (pid == -1)
|
|
|
|
- perr("Cannot fork");
|
|
|
|
-
|
|
|
|
+ if (pid == -1) {
|
|
|
|
+ lerr("Cannot fork for job execution");
|
|
|
|
+ free(mailname);
|
|
|
|
+ free(newname);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
else if (pid != 0) {
|
|
|
|
free(mailname);
|
|
|
|
free(newname);
|
2022-02-22 16:01:05 +00:00
|
|
|
@@ -659,16 +662,20 @@
|
2016-03-23 14:24:03 +00:00
|
|
|
* up.
|
|
|
|
*/
|
|
|
|
|
|
|
|
- if (stat(".", &buf) == -1)
|
|
|
|
- perr("Cannot stat " ATJOB_DIR);
|
|
|
|
+ if (stat(".", &buf) == -1) {
|
|
|
|
+ lerr("Cannot stat " ATJOB_DIR);
|
|
|
|
+ return next_job;
|
|
|
|
+ }
|
|
|
|
|
2022-02-22 16:01:05 +00:00
|
|
|
if (nothing_to_do && buf.st_mtime == last_chg)
|
2016-03-23 14:24:03 +00:00
|
|
|
return next_job;
|
|
|
|
last_chg = buf.st_mtime;
|
|
|
|
|
2022-02-22 16:01:05 +00:00
|
|
|
hupped = 0;
|
2016-03-23 14:24:03 +00:00
|
|
|
- if ((spool = opendir(".")) == NULL)
|
|
|
|
- perr("Cannot read " ATJOB_DIR);
|
|
|
|
+ if ((spool = opendir(".")) == NULL) {
|
|
|
|
+ lerr("Cannot read " ATJOB_DIR);
|
|
|
|
+ return next_job;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
run_batch = 0;
|
|
|
|
nothing_to_do = 1;
|