commit 62614f0b3f6432d3e9f67869594c4e1d7984c147 Merge: e0b8a79b2e 272cb803df Author: George Kadianakis desnacked@riseup.net Date: Thu Apr 8 14:37:30 2021 +0300
Merge remote-tracking branch 'tor-gitlab/mr/354'
changes/bug40354 | 4 ++++ src/lib/fs/path.c | 2 ++ 2 files changed, 6 insertions(+)
diff --cc src/lib/fs/path.c index 81eb3aa661,dc1741447e..8194d920ab --- a/src/lib/fs/path.c +++ b/src/lib/fs/path.c @@@ -571,19 -572,7 +572,20 @@@ wrap_closedir(void *arg { closedir(arg); } + #endif /* defined(GLOB_ALTDIRFUNC) */ + +/** Function passed to glob to handle processing errors. <b>epath</b> is the + * path that caused the error and <b>eerrno</b> is the errno set by the + * function that failed. We want to ignore ENOENT and ENOTDIR because, in BSD + * systems, these are not ignored automatically, which makes glob fail when + * globs expand to non-existing paths and GLOB_ERR is set. + */ +static int +glob_errfunc(const char *epath, int eerrno) +{ + (void)epath; + return eerrno == ENOENT || eerrno == ENOTDIR ? 0 : -1; +} #endif /* defined(HAVE_GLOB) */
/** Return a new list containing the paths that match the pattern
tor-commits@lists.torproject.org