summaryrefslogtreecommitdiff
path: root/news/knews/files/patch-file.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--news/knews/files/patch-file.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/news/knews/files/patch-file.c b/news/knews/files/patch-file.c
index 7a3409474641..83d1cd661508 100644
--- a/news/knews/files/patch-file.c
+++ b/news/knews/files/patch-file.c
@@ -4,7 +4,7 @@ Use mkstemp instead of tmpnam. Copied from the tmpnam implementation :)
--- src/file.c Fri Jan 9 12:16:19 1998
+++ src/file.c Fri Jul 13 10:41:01 2001
-@@ -187,13 +187,12 @@
+@@ -187,13 +187,11 @@
int fd;
+ static unsigned long tmpcount;
+ static char buf[L_tmpnam];
@@ -18,11 +18,10 @@ Use mkstemp instead of tmpnam. Copied from the tmpnam implementation :)
+ fd = mkstemp(buf);
+ if (fd < 0)
+ *name = NULL;
-+ else
- unlink(*name);
+- unlink(*name);
- fd = open(*name, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR);
- if (fd < 0)
- *name = NULL;
- }
--
+
return fd;