]> git.ipfire.org Git - thirdparty/git.git/commitdiff
wrapper.c: only define gitmkstemps if needed
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>
Sun, 6 Oct 2013 20:50:00 +0000 (21:50 +0100)
committerJonathan Nieder <jrnieder@gmail.com>
Mon, 14 Oct 2013 23:16:00 +0000 (16:16 -0700)
When the NO_MKSTEMPS build variable is not set, the gitmkstemps
function is dead code.  Use a preprocessor conditional to only include
the definition when needed.

Noticed by sparse.  ("'gitmkstemps' was not declared. Should it be
static?")

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
wrapper.c

index f92b14759833b1ae77070b4188d8ad8ea8d3799e..9a6aaafaf35bbd6d2a7a97589edfd9b0b12102c7 100644 (file)
--- a/wrapper.c
+++ b/wrapper.c
@@ -360,10 +360,12 @@ int git_mkstemp_mode(char *pattern, int mode)
        return git_mkstemps_mode(pattern, 0, mode);
 }
 
+#ifdef NO_MKSTEMPS
 int gitmkstemps(char *pattern, int suffix_len)
 {
        return git_mkstemps_mode(pattern, suffix_len, 0600);
 }
+#endif
 
 int xmkstemp_mode(char *template, int mode)
 {