]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Move mkstemp() replacement to before its use.
authorRamiro Polla <ramiro.polla@gmail.com>
Sun, 9 May 2010 22:25:28 +0000 (19:25 -0300)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 10 May 2010 19:14:39 +0000 (21:14 +0200)
util.c

diff --git a/util.c b/util.c
index 0aef7f972d11f33eef25bc8d3ead8d159ab5a683..f7511a43e09b18cd092776885e37f2d339ef4e6d 100644 (file)
--- 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)
 {