mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 22:58:50 +01:00
Use correct type for gl_closedir to avoid a compiler warning
This commit is contained in:
parent
e151442037
commit
9ef991dbe3
1 changed files with 7 additions and 1 deletions
|
@ -553,6 +553,12 @@ prot_lstat(const char *pathname, struct stat *buf)
|
||||||
{
|
{
|
||||||
return lstat(sandbox_intern_string(pathname), buf);
|
return lstat(sandbox_intern_string(pathname), buf);
|
||||||
}
|
}
|
||||||
|
/** As closedir, but has the right type for gl_closedir */
|
||||||
|
static void
|
||||||
|
wrap_closedir(void *arg)
|
||||||
|
{
|
||||||
|
closedir(arg);
|
||||||
|
}
|
||||||
#endif /* defined(_WIN32) */
|
#endif /* defined(_WIN32) */
|
||||||
|
|
||||||
/** Return a new list containing the paths that match the pattern
|
/** Return a new list containing the paths that match the pattern
|
||||||
|
@ -580,7 +586,7 @@ tor_glob(const char *pattern)
|
||||||
typedef void (*gl_closedir)(void *);
|
typedef void (*gl_closedir)(void *);
|
||||||
matches.gl_opendir = (gl_opendir) &prot_opendir;
|
matches.gl_opendir = (gl_opendir) &prot_opendir;
|
||||||
matches.gl_readdir = (gl_readdir) &readdir;
|
matches.gl_readdir = (gl_readdir) &readdir;
|
||||||
matches.gl_closedir = (gl_closedir) &closedir;
|
matches.gl_closedir = (gl_closedir) &wrap_closedir;
|
||||||
matches.gl_stat = &prot_stat;
|
matches.gl_stat = &prot_stat;
|
||||||
matches.gl_lstat = &prot_lstat;
|
matches.gl_lstat = &prot_lstat;
|
||||||
#endif /* defined(GLOB_ALTDIRFUNC) */
|
#endif /* defined(GLOB_ALTDIRFUNC) */
|
||||||
|
|
Loading…
Add table
Reference in a new issue