Commit 82371fdd by Serge Hallyn Committed by Stéphane Graber

fopen_cloexec: simplify open call

parent db27c8d7
......@@ -510,9 +510,7 @@ FILE *fopen_cloexec(const char *path, const char *mode)
open_mode |= O_EXCL;
open_mode |= O_CLOEXEC;
fd = (open_mode & O_CREAT) ?
open(path, open_mode, 0666) :
open(path, open_mode);
fd = open(path, open_mode, 0666);
if (fd < 0)
return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment