aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-08-12 14:42:30 -0400
committerNick Mathewson <nickm@torproject.org>2020-08-12 14:42:30 -0400
commit9ef991dbe37b18c1d3af4a5a4d0b674d3f18cc5f (patch)
tree8fcf9ecd06c3a9a553f3ddf3356b5cb596e53da9 /src/lib
parente1514420377b2290dfa52fa65374276a66973131 (diff)
downloadtor-9ef991dbe37b18c1d3af4a5a4d0b674d3f18cc5f.tar.gz
tor-9ef991dbe37b18c1d3af4a5a4d0b674d3f18cc5f.zip
Use correct type for gl_closedir to avoid a compiler warning
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/fs/path.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/fs/path.c b/src/lib/fs/path.c
index 1a60ca70d4..f03cecf52d 100644
--- a/src/lib/fs/path.c
+++ b/src/lib/fs/path.c
@@ -553,6 +553,12 @@ prot_lstat(const char *pathname, struct stat *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) */
/** 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 *);
matches.gl_opendir = (gl_opendir) &prot_opendir;
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_lstat = &prot_lstat;
#endif /* defined(GLOB_ALTDIRFUNC) */