summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-mkstemp.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-mkstemp.patch')
-rw-r--r--meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-mkstemp.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-mkstemp.patch b/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-mkstemp.patch
new file mode 100644
index 0000000000..e49e3e4d1d
--- /dev/null
+++ b/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-mkstemp.patch
@@ -0,0 +1,28 @@
1Upstream-Status: Inappropriate [1]
2
3[1] Not the author, the patch is from:
4http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm
5
6--- rdist-6.1.5/src/server.c.mkstemp 2004-05-25 14:29:37.279312752 +0200
7+++ rdist-6.1.5/src/server.c 2004-05-25 14:31:27.050744340 +0200
8@@ -1479,11 +1479,18 @@
9 *file = '/';
10 }
11 fd = mkstemp(new);
12- if (fd < 0) {
13+ /*
14+ * Don't consider it a fatal error if mkstemp() fails
15+ * because parent directory didn't exist. (Missing
16+ * parents are created later (in recvfile())
17+ */
18+ if ((fd < 0) && (errno != ENOENT)) {
19 error("Cannot set file name.");
20 return;
21+ } else if (fd >= 0) {
22+ close(fd);
23+ unlink(new); /* Or symlink() will fail */
24 }
25- close(fd);
26 }
27
28 /*