Skip to content

Commit ec145c9

Browse files
Ramsay Jonesjrn
authored andcommitted
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 <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]>
1 parent ce1e846 commit ec145c9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

wrapper.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,12 @@ int git_mkstemp_mode(char *pattern, int mode)
360360
return git_mkstemps_mode(pattern, 0, mode);
361361
}
362362

363+
#ifdef NO_MKSTEMPS
363364
int gitmkstemps(char *pattern, int suffix_len)
364365
{
365366
return git_mkstemps_mode(pattern, suffix_len, 0600);
366367
}
368+
#endif
367369

368370
int xmkstemp_mode(char *template, int mode)
369371
{

0 commit comments

Comments
 (0)