Avoid unused function warnings on libc's without GLOB_ALTDIRFUNC #40354

This commit is contained in:
Daniel Pinto 2021-03-24 22:20:29 +00:00
parent c359c3056b
commit 272cb803df
2 changed files with 6 additions and 0 deletions

4
changes/bug40354 Normal file
View File

@ -0,0 +1,4 @@
o Minor bugfixes (compilation):
- Fix a compilation warning about unused functions when building with
a libc that lacks the GLOB_ALTDIRFUNC constant. Fixes bug 40354;
bugfix on 0.4.5.1-alpha. Patch by Daniel Pinto.

View File

@ -533,6 +533,7 @@ unglob_win32(const char *pattern, int prev_sep, int next_sep)
return result;
}
#elif HAVE_GLOB
#ifdef GLOB_ALTDIRFUNC // prevent warning about unused functions
/** Same as opendir but calls sandbox_intern_string before */
static DIR *
prot_opendir(const char *name)
@ -571,6 +572,7 @@ wrap_closedir(void *arg)
{
closedir(arg);
}
#endif /* defined(GLOB_ALTDIRFUNC) */
#endif /* defined(HAVE_GLOB) */
/** Return a new list containing the paths that match the pattern