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

4e3b3d
diff -up at-3.1.13/at.c.fclose at-3.1.13/at.c
4e3b3d
--- at-3.1.13/at.c.fclose	2016-04-20 17:15:00.584327893 +0200
4e3b3d
+++ at-3.1.13/at.c	2016-04-20 17:15:50.453609665 +0200
4e3b3d
@@ -209,7 +209,11 @@ nextjob()
4e3b3d
     jobno = (1 + jobno) % 0xfffff;	/* 2^20 jobs enough? */
4e3b3d
     fprintf(fid, "%05lx\n", jobno);
4e3b3d
 
4e3b3d
-    fclose(fid);
4e3b3d
+    if (ferror(fid))
4e3b3d
+	jobno = EOF;
4e3b3d
+
4e3b3d
+    if (fclose(fid) != 0)
4e3b3d
+	jobno = EOF;
4e3b3d
     return jobno;
4e3b3d
 }
4e3b3d
 
4e3b3d
@@ -498,7 +502,8 @@ writefile(time_t runtimer, char queue)
4e3b3d
     if (ferror(stdin))
4e3b3d
 	panic("Input error");
4e3b3d
 
4e3b3d
-    fclose(fp);
4e3b3d
+    if (fclose(fp) != 0)
4e3b3d
+	panic("Output error");
4e3b3d
 
4e3b3d
     /* Set the x bit so that we're ready to start executing
4e3b3d
      */