everywhere: always use O_CLOEXEC where it makes sense
This commit is contained in:
+1
-1
@@ -130,7 +130,7 @@ ssize_t sendfile_full(int out_fd, const char *fn) {
|
||||
assert(out_fd > 0);
|
||||
assert(fn);
|
||||
|
||||
f = fopen(fn, "r");
|
||||
f = fopen(fn, "re");
|
||||
if (!f)
|
||||
return -errno;
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ static int hibernation_partition_size(size_t *size, size_t *used) {
|
||||
assert(size);
|
||||
assert(used);
|
||||
|
||||
f = fopen("/proc/swaps", "r");
|
||||
f = fopen("/proc/swaps", "re");
|
||||
if (!f) {
|
||||
log_full(errno == ENOENT ? LOG_DEBUG : LOG_WARNING,
|
||||
"Failed to retrieve open /proc/swaps: %m");
|
||||
|
||||
Reference in New Issue
Block a user