Blob Blame History Raw
diff -up at-3.1.18/atd.c.noabort at-3.1.18/atd.c
--- at-3.1.18/atd.c.noabort	2016-03-23 12:49:15.147520116 +0100
+++ at-3.1.18/atd.c	2016-03-23 12:49:15.148520138 +0100
@@ -349,9 +349,12 @@ run_file(const char *filename, uid_t uid
      */
 
     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);
@@ -669,15 +672,19 @@ run_loop()
      * up.
      */
 
-    if (stat(".", &buf) == -1)
-	perr("Cannot stat " ATJOB_DIR);
+    if (stat(".", &buf) == -1) {
+	lerr("Cannot stat " ATJOB_DIR);
+        return next_job;
+    }
 
     if (nothing_to_do && buf.st_mtime <= last_chg)
 	return next_job;
     last_chg = buf.st_mtime;
 
-    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;