diff options
author | Mikhail Teterin <mi@FreeBSD.org> | 2001-08-15 22:41:46 +0000 |
---|---|---|
committer | Mikhail Teterin <mi@FreeBSD.org> | 2001-08-15 22:41:46 +0000 |
commit | 898e952ce96211235e1c617a0e07448e44849b48 (patch) | |
tree | 2dce162c2bea703f6fc859af62aa5dd4ab35ed82 /news/knews/files | |
parent | Oops, fix KOffice 1.1rc1 pointer too. :\ (diff) |
Fix a bug in my patch, which caused the temporary file to be unlinked
unfairly. Thanks, Alex!
Submitted by: Alexander Leidinger
Notes
Notes:
svn path=/head/; revision=46300
Diffstat (limited to 'news/knews/files')
-rw-r--r-- | news/knews/files/patch-file.c | 7 |
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; |