tree-wide: make use of errno_or_else() everywhere

This commit is contained in:
Lennart Poettering
2019-07-11 23:20:31 +02:00
parent fed813778f
commit 66855de739
16 changed files with 60 additions and 58 deletions
+2 -2
View File
@@ -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;