Blame SOURCES/at-3.1.16-fclose-error.patch

76a39a
diff -up at-3.1.16/at.c.fclose at-3.1.16/at.c
76a39a
--- at-3.1.16/at.c.fclose	2014-11-06 16:11:28.000000000 +0100
76a39a
+++ at-3.1.16/at.c	2014-11-24 15:30:12.704502966 +0100
76a39a
@@ -209,7 +209,11 @@ nextjob()
76a39a
     jobno = (1 + jobno) % 0xfffff;	/* 2^20 jobs enough? */
76a39a
     fprintf(fid, "%05lx\n", jobno);
76a39a
 
76a39a
-    fclose(fid);
76a39a
+    if (ferror(fid))
76a39a
+	jobno = EOF;
76a39a
+
76a39a
+    if (fclose(fid) != 0)
76a39a
+	jobno = EOF;
76a39a
     return jobno;
76a39a
 }
76a39a
 
76a39a
@@ -494,7 +498,8 @@ writefile(time_t runtimer, char queue)
76a39a
     if (ferror(stdin))
76a39a
 	panic("Input error");
76a39a
 
76a39a
-    fclose(fp);
76a39a
+    if (fclose(fp) != 0)
76a39a
+	panic("Output error");
76a39a
 
76a39a
     /* Set the x bit so that we're ready to start executing
76a39a
      */