projects
/
platform
/
upstream
/
curl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a52857c
)
file: use fdopen() for uploaded files if available
author
Kamil Dudka
<kdudka@redhat.com>
Mon, 30 Jul 2012 12:20:07 +0000
(14:20 +0200)
committer
Kamil Dudka
<kdudka@redhat.com>
Mon, 30 Jul 2012 13:04:38 +0000
(15:04 +0200)
It eliminates noisy events when using inotify and fixes a TOCTOU issue.
Bug: https://bugzilla.redhat.com/844385
lib/file.c
patch
|
blob
|
history
diff --git
a/lib/file.c
b/lib/file.c
index
4447c73
..
1025022
100644
(file)
--- a/
lib/file.c
+++ b/
lib/file.c
@@
-351,8
+351,12
@@
static CURLcode file_upload(struct connectdata *conn)
failf(data, "Can't open %s for writing", file->path);
return CURLE_WRITE_ERROR;
}
+#ifdef HAVE_FDOPEN
+ fp = fdopen(fd, "wb");
+#else
close(fd);
fp = fopen(file->path, "wb");
+#endif
}
if(!fp) {