FreeBSD Bugzilla – Attachment 156132 Details for
Bug 199801
libfetch should use option letter "e" with fopen() to force O_CLOEXEC instead of calling fcntl() later
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Add "e" to fopen() options and remove the fcntl() calls.
libfetch-O_CLOEXEC.patch (text/plain), 771 bytes, created by
jau
on 2015-04-30 10:13:09 UTC
(
hide
)
Description:
Add "e" to fopen() options and remove the fcntl() calls.
Filename:
MIME Type:
Creator:
jau
Created:
2015-04-30 10:13:09 UTC
Size:
771 bytes
patch
obsolete
>Index: lib/libfetch/file.c >=================================================================== >--- lib/libfetch/file.c (revision 282268) >+++ lib/libfetch/file.c (working copy) >@@ -48,7 +48,7 @@ > 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 @@ > return (NULL); > } > >- fcntl(fileno(f), F_SETFD, FD_CLOEXEC); > return (f); > } > >@@ -77,9 +76,9 @@ > 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 @@ > return (NULL); > } > >- fcntl(fileno(f), F_SETFD, FD_CLOEXEC); > return (f); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 199801
: 156132