diff options
author | Karel Zak | 2014-06-18 12:57:42 +0200 |
---|---|---|
committer | Karel Zak | 2014-06-18 12:57:42 +0200 |
commit | f272b32c57dcfd440f01c2eae119dce1aea5611e (patch) | |
tree | d9d814f7e719aee08d70b41d6a67bfd369684399 /include/fileutils.h | |
parent | lscpu: fix ifdef HAVE_sys_io_h [checkconfig] (diff) | |
download | kernel-qcow2-util-linux-f272b32c57dcfd440f01c2eae119dce1aea5611e.tar.gz kernel-qcow2-util-linux-f272b32c57dcfd440f01c2eae119dce1aea5611e.tar.xz kernel-qcow2-util-linux-f272b32c57dcfd440f01c2eae119dce1aea5611e.zip |
lib/fileutils: xalloc stuff in library-like code
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/fileutils.h')
-rw-r--r-- | include/fileutils.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/fileutils.h b/include/fileutils.h index 2144e5e5d..98798f7ee 100644 --- a/include/fileutils.h +++ b/include/fileutils.h @@ -7,10 +7,11 @@ static inline FILE *xfmkstemp(char **tmpname, char *dir) { int fd; FILE *ret; + fd = xmkstemp(tmpname, dir); - if (fd == -1) { + if (fd == -1) return NULL; - } + if (!(ret = fdopen(fd, "w+" UL_CLOEXECSTR))) { close(fd); return NULL; |