ce9709
diff -up at-3.1.18/atd.c.noabort at-3.1.18/atd.c
ce9709
--- at-3.1.18/atd.c.noabort	2016-03-23 12:49:15.147520116 +0100
ce9709
+++ at-3.1.18/atd.c	2016-03-23 12:49:15.148520138 +0100
ce9709
@@ -349,9 +349,12 @@ run_file(const char *filename, uid_t uid
ce9709
      */
ce9709
 
ce9709
     pid = fork();
ce9709
-    if (pid == -1)
ce9709
-	perr("Cannot fork");
ce9709
-
ce9709
+    if (pid == -1) {
ce9709
+	lerr("Cannot fork for job execution");
ce9709
+	free(mailname);
ce9709
+	free(newname);
ce9709
+	return;
ce9709
+    }
ce9709
     else if (pid != 0) {
ce9709
 	free(mailname);
ce9709
 	free(newname);
ce9709
@@ -669,15 +672,19 @@ run_loop()
ce9709
      * up.
ce9709
      */
ce9709
 
ce9709
-    if (stat(".", &buf) == -1)
ce9709
-	perr("Cannot stat " ATJOB_DIR);
ce9709
+    if (stat(".", &buf) == -1) {
ce9709
+	lerr("Cannot stat " ATJOB_DIR);
ce9709
+        return next_job;
ce9709
+    }
ce9709
 
ce9709
     if (nothing_to_do && buf.st_mtime <= last_chg)
ce9709
 	return next_job;
ce9709
     last_chg = buf.st_mtime;
ce9709
 
ce9709
-    if ((spool = opendir(".")) == NULL)
ce9709
-	perr("Cannot read " ATJOB_DIR);
ce9709
+    if ((spool = opendir(".")) == NULL) {
ce9709
+	lerr("Cannot read " ATJOB_DIR);
ce9709
+        return next_job;
ce9709
+    }
ce9709
 
ce9709
     run_batch = 0;
ce9709
     nothing_to_do = 1;