From 8392c6a83d40a4deec61b7fad57dba16d344fa6e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 16 Jan 2008 04:43:19 +0000 Subject: [PATCH] - API: fix to zip code (from Carl C) svn path=/trunk/boinc/; revision=14563 --- checkin_notes | 6 ++++++ zip/zip/z_fileio.c | 11 +++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/checkin_notes b/checkin_notes index 7a8fad0e40..9998674635 100644 --- a/checkin_notes +++ b/checkin_notes @@ -599,3 +599,9 @@ David Jan 15 2008 create_profile.php lib/ filesys.C + +David Jan 15 2008 + - API: fix to zip code (from Carl C) + + zip/zip/ + z_fileio.c diff --git a/zip/zip/z_fileio.c b/zip/zip/z_fileio.c index 0e92665453..b6aefaef79 100644 --- a/zip/zip/z_fileio.c +++ b/zip/zip/z_fileio.c @@ -862,10 +862,13 @@ char *zip; /* path name of zip file to generate temp name for */ #ifdef _WIN32 return mktemp(t); #else - if (mkstemp(t)) - return t; - else - return NULL; + int fd = mkstemp(t); + if (fd) { + close(fd); + return t; + } else { + return NULL; + } #endif /* MKSTEMP */ #endif /* NO_MKTEMP */ #endif /* TANDEM */