From f272b32c57dcfd440f01c2eae119dce1aea5611e Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 18 Jun 2014 12:57:42 +0200 Subject: lib/fileutils: xalloc stuff in library-like code Signed-off-by: Karel Zak --- include/fileutils.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/fileutils.h') 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; -- cgit v1.2.3-55-g7522