tree-wide: make use of errno_or_else() everywhere
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "dirent-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "glob-util.h"
|
||||
#include "macro.h"
|
||||
#include "path-util.h"
|
||||
@@ -36,13 +37,12 @@ int safe_glob(const char *path, int flags, glob_t *pglob) {
|
||||
|
||||
errno = 0;
|
||||
k = glob(path, flags | GLOB_ALTDIRFUNC, NULL, pglob);
|
||||
|
||||
if (k == GLOB_NOMATCH)
|
||||
return -ENOENT;
|
||||
if (k == GLOB_NOSPACE)
|
||||
return -ENOMEM;
|
||||
if (k != 0)
|
||||
return errno > 0 ? -errno : -EIO;
|
||||
return errno_or_else(EIO);
|
||||
if (strv_isempty(pglob->gl_pathv))
|
||||
return -ENOENT;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user