From: Ramiro Polla Date: Sun, 9 May 2010 22:25:28 +0000 (-0300) Subject: Move mkstemp() replacement to before its use. X-Git-Tag: v3.0pre1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e40dc54424e8eda709b29cbeeae96be5415baba;p=thirdparty%2Fccache.git Move mkstemp() replacement to before its use. --- diff --git a/util.c b/util.c index 0aef7f972..f7511a43e 100644 --- a/util.c +++ b/util.c @@ -162,6 +162,16 @@ void copy_fd(int fd_in, int fd_out) } } +#ifndef HAVE_MKSTEMP +/* cheap and nasty mkstemp replacement */ +int mkstemp(char *template) +{ + mktemp(template); + return open(template, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0600); +} +#endif + + /* * Copy src to dest, decompressing src if needed. compress_dest decides whether * dest will be compressed. @@ -803,16 +813,6 @@ char *gnu_getcwd(void) } } -#ifndef HAVE_MKSTEMP -/* cheap and nasty mkstemp replacement */ -int mkstemp(char *template) -{ - mktemp(template); - return open(template, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0600); -} -#endif - - /* create an empty file */ int create_empty_file(const char *fname) {