Blame rdist-6.1.5-mkstemp.patch
|
cvsdist |
efc35b6 |
--- rdist-6.1.5/src/server.c.mkstemp 2004-05-25 14:29:37.279312752 +0200
|
|
cvsdist |
efc35b6 |
+++ rdist-6.1.5/src/server.c 2004-05-25 14:31:27.050744340 +0200
|
|
Michal Luscon |
f5c9a76 |
@@ -1473,11 +1473,18 @@
|
|
cvsdist |
9048ab0 |
*file = '/';
|
|
cvsdist |
9048ab0 |
}
|
|
cvsdist |
9048ab0 |
fd = mkstemp(new);
|
|
cvsdist |
9048ab0 |
- if (fd < 0) {
|
|
cvsdist |
9048ab0 |
+ /*
|
|
cvsdist |
9048ab0 |
+ * Don't consider it a fatal error if mkstemp() fails
|
|
cvsdist |
9048ab0 |
+ * because parent directory didn't exist. (Missing
|
|
cvsdist |
9048ab0 |
+ * parents are created later (in recvfile())
|
|
cvsdist |
9048ab0 |
+ */
|
|
cvsdist |
9048ab0 |
+ if ((fd < 0) && (errno != ENOENT)) {
|
|
cvsdist |
9048ab0 |
error("Cannot set file name.");
|
|
cvsdist |
9048ab0 |
return;
|
|
cvsdist |
efc35b6 |
+ } else if (fd >= 0) {
|
|
cvsdist |
9048ab0 |
+ close(fd);
|
|
cvsdist |
efc35b6 |
+ unlink(new); /* Or symlink() will fail */
|
|
cvsdist |
efc35b6 |
}
|
|
cvsdist |
efc35b6 |
- close(fd);
|
|
cvsdist |
9048ab0 |
}
|
|
cvsdist |
9048ab0 |
|
|
cvsdist |
9048ab0 |
/*
|