summaryrefslogtreecommitdiff
path: root/autogen-catch-race-error.patch
blob: be76e2f8199a40b104dd3d891190be1ca25601a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Origin: https://build.opensuse.org/package/show/openSUSE:Factory/autogen
Bug: https://bugzilla.opensuse.org/show_bug.cgi?id=1021353
Forwarded: https://savannah.gnu.org/support/index.php?109234
Description: This would have made the racy build fail
 instead of producing missing and incorrect files
Author: Bernhard Wiedemann <bwiedemann@suse.com>

Index: autogen-5.18.16/agen5/agDep.c
===================================================================
--- autogen-5.18.16.orig/agen5/agDep.c
+++ autogen-5.18.16/agen5/agDep.c
@@ -308,7 +308,7 @@ tidy_dep_file(void)
         pzn[len] = NUL;
 
         unlink(pzn);
-        rename(dep_file, pzn);
+        if (rename(dep_file, pzn)) { exit(95); }
         AGFREE(dep_file);
         dep_file = pzn;
     } while (false);
Index: autogen-5.18.16/agen5/expOutput.c
===================================================================
--- autogen-5.18.16.orig/agen5/expOutput.c
+++ autogen-5.18.16/agen5/expOutput.c
@@ -251,7 +251,7 @@ ag_scm_out_move(SCM new_file)
 
     if (strcmp(pz, cur_fpstack->stk_fname) != 0) {
 
-        rename(cur_fpstack->stk_fname, pz);
+        if (rename(cur_fpstack->stk_fname, pz)) { exit(94); }
 
         if (dep_fp != NULL) {
             rm_target_file(cur_fpstack->stk_fname);