aboutsummaryrefslogtreecommitdiffstats
path: root/community/at/0010-fclose-error.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/at/0010-fclose-error.patch')
-rw-r--r--community/at/0010-fclose-error.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/community/at/0010-fclose-error.patch b/community/at/0010-fclose-error.patch
new file mode 100644
index 00000000000..e8f4f573f28
--- /dev/null
+++ b/community/at/0010-fclose-error.patch
@@ -0,0 +1,35 @@
+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
+ */