diff options
Diffstat (limited to 'lib/libfetch/file.c')
-rw-r--r-- | lib/libfetch/file.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libfetch/file.c b/lib/libfetch/file.c index 8c1d404..7b6462f 100644 --- a/lib/libfetch/file.c +++ b/lib/libfetch/file.c @@ -48,7 +48,7 @@ fetchXGetFile(struct url *u, struct url_stat *us, const char *flags) if (us && fetchStatFile(u, us, flags) == -1) return (NULL); - f = fopen(u->doc, "r"); + f = fopen(u->doc, "re"); if (f == NULL) { fetch_syserr(); @@ -61,7 +61,6 @@ fetchXGetFile(struct url *u, struct url_stat *us, const char *flags) return (NULL); } - fcntl(fileno(f), F_SETFD, FD_CLOEXEC); return (f); } @@ -77,9 +76,9 @@ fetchPutFile(struct url *u, const char *flags) FILE *f; if (CHECK_FLAG('a')) - f = fopen(u->doc, "a"); + f = fopen(u->doc, "ae"); else - f = fopen(u->doc, "w+"); + f = fopen(u->doc, "w+e"); if (f == NULL) { fetch_syserr(); @@ -92,7 +91,6 @@ fetchPutFile(struct url *u, const char *flags) return (NULL); } - fcntl(fileno(f), F_SETFD, FD_CLOEXEC); return (f); } |