summaryrefslogtreecommitdiff
path: root/source/n/rdist/rdist-6.1.5-11.mkstemp.diff
diff options
context:
space:
mode:
Diffstat (limited to 'source/n/rdist/rdist-6.1.5-11.mkstemp.diff')
-rw-r--r--source/n/rdist/rdist-6.1.5-11.mkstemp.diff23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/n/rdist/rdist-6.1.5-11.mkstemp.diff b/source/n/rdist/rdist-6.1.5-11.mkstemp.diff
new file mode 100644
index 00000000..9d9297a8
--- /dev/null
+++ b/source/n/rdist/rdist-6.1.5-11.mkstemp.diff
@@ -0,0 +1,23 @@
+--- rdist-6.1.5/src/server.c.mkstemp 2004-05-25 14:29:37.279312752 +0200
++++ rdist-6.1.5/src/server.c 2004-05-25 14:31:27.050744340 +0200
+@@ -1479,11 +1479,18 @@
+ *file = '/';
+ }
+ fd = mkstemp(new);
+- if (fd < 0) {
++ /*
++ * Don't consider it a fatal error if mkstemp() fails
++ * because parent directory didn't exist. (Missing
++ * parents are created later (in recvfile())
++ */
++ if ((fd < 0) && (errno != ENOENT)) {
+ error("Cannot set file name.");
+ return;
++ } else if (fd >= 0) {
++ close(fd);
++ unlink(new); /* Or symlink() will fail */
+ }
+- close(fd);
+ }
+
+ /*