Skip to content

Commit

Permalink
wrapper.c: only define gitmkstemps if needed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ramsay Jones authored and Jonathan Nieder committed Oct 14, 2013
1 parent ce1e846 commit ec145c9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit ec145c9

Please sign in to comment.