wrapper.c: only define gitmkstemps if needed
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>
Ramsay Jones committed
Oct 6, 2013 at 21:50 UTC
ec145c9c2ef0ddf0ca8b57b968054f4db9de63b3
1 file changed
+2
wrapper.c
+2
@@ -360,10 +360,12 @@ int git_mkstemp_mode(char *pattern, int mode)
360
return git_mkstemps_mode(pattern, 0, mode);
361
}
362
363
+#ifdef NO_MKSTEMPS
364
int gitmkstemps(char *pattern, int suffix_len)
365
{
366
return git_mkstemps_mode(pattern, suffix_len, 0600);
367
}
368
+#endif
369
370
int xmkstemp_mode(char *template, int mode)
371
{