]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
fopen_cloexec: simplify open call
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 10 Sep 2013 19:29:10 +0000 (14:29 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 10 Sep 2013 22:19:21 +0000 (18:19 -0400)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/utils.c

index b188c4780185aa28950b0ddff456fdd013942e76..3512979adbf8ed8a63948d51abdcc4e1c3d75829 100644 (file)
@@ -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;