From: Serge Hallyn Date: Tue, 10 Sep 2013 19:29:10 +0000 (-0500) Subject: fopen_cloexec: simplify open call X-Git-Tag: lxc-1.0.0.alpha2~142 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=82371fdd64e31e4fa3ba168c31a7e66c98343f84;p=thirdparty%2Flxc.git fopen_cloexec: simplify open call Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/utils.c b/src/lxc/utils.c index b188c4780..3512979ad 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -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;