Patch-Source: https://src.fedoraproject.org/rpms/at/blob/f36/f/at-3.1.16-fclose-error.patch (updated)
--
From 4fe15d5740188a3ac3f1dafed3a26e2165ececd4 Mon Sep 17 00:00:00 2001
From: Tomas Mraz <tmraz@fedoraproject.org>
Date: Nov 24 2014 14:35:59 +0000
Subject: test for write error on fclose (#1166882)

https://bugzilla.redhat.com/show_bug.cgi?id=1166882

diff --git a/at.c b/at.c
--- a/at.c
+++ b/at.c
@@ -228,7 +228,11 @@ nextjob()
     jobno = (1 + jobno) % 0xfffff;	/* 2^20 jobs enough? */
     fprintf(fid, "%05lx\n", jobno);
 
-    fclose(fid);
+    if (ferror(fid))
+	jobno = EOF;
+
+    if (fclose(fid) != 0)
+	jobno = EOF;
     return jobno;
 }
 
@@ -532,7 +536,8 @@ writefile(time_t runtimer, char queue)
     if (ferror(stdin))
 	panic("Input error");
 
-    fclose(fp);
+    if (fclose(fp) != 0)
+	panic("Output error");
 
     /* Set the x bit so that we're ready to start executing
      */
