summaryrefslogtreecommitdiffstats
path: root/include/fileutils.h
diff options
context:
space:
mode:
authorKarel Zak2014-06-18 12:57:42 +0200
committerKarel Zak2014-06-18 12:57:42 +0200
commitf272b32c57dcfd440f01c2eae119dce1aea5611e (patch)
treed9d814f7e719aee08d70b41d6a67bfd369684399 /include/fileutils.h
parentlscpu: fix ifdef HAVE_sys_io_h [checkconfig] (diff)
downloadkernel-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.h5
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;