]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
include/fileutils: use O_CLOEXEC for mktemp stuff
authorKarel Zak <kzak@redhat.com>
Wed, 3 Apr 2013 14:12:34 +0000 (16:12 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 3 Apr 2013 14:12:34 +0000 (16:12 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
include/fileutils.h

index cf29e1b83d15a56f7c1eb2e718ee71f01b8a043d..d0d4505cdbf0db7e858c8dd91e9302810150c5cb 100644 (file)
@@ -11,7 +11,7 @@ static inline FILE *xfmkstemp(char **tmpname, char *dir)
        if (fd == -1) {
                return NULL;
        }
-       if (!(ret = fdopen(fd, "w+"))) {
+       if (!(ret = fdopen(fd, "w+" UL_CLOEXECSTR))) {
                close(fd);
                return NULL;
        }