tree-wide: Remove O_CLOEXEC from fdopen
fdopen doesn't accept "e", it's ignored. Let's not mislead people into believing that it actually sets O_CLOEXEC. From `man 3 fdopen`: > e (since glibc 2.7): > Open the file with the O_CLOEXEC flag. See open(2) for more information. This flag is ignored for fdopen() As mentioned by @jlebon in #11131.
This commit is contained in:
committed by
Lennart Poettering
parent
9be3c60570
commit
e92aaed30e
+1
-1
@@ -156,7 +156,7 @@ int write_string_file_ts(
|
||||
goto fail;
|
||||
}
|
||||
|
||||
f = fdopen(fd, "we");
|
||||
f = fdopen(fd, "w");
|
||||
if (!f) {
|
||||
r = -errno;
|
||||
safe_close(fd);
|
||||
|
||||
@@ -36,7 +36,7 @@ int fopen_temporary(const char *path, FILE **_f, char **_temp_path) {
|
||||
return -errno;
|
||||
}
|
||||
|
||||
f = fdopen(fd, "we");
|
||||
f = fdopen(fd, "w");
|
||||
if (!f) {
|
||||
unlink_noerrno(t);
|
||||
free(t);
|
||||
|
||||
Reference in New Issue
Block a user