aboutsummaryrefslogtreecommitdiffstats
path: root/lib/path.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/path.c')
-rw-r--r--lib/path.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/path.c b/lib/path.c
index c878d2d962..202f19ac4f 100644
--- a/lib/path.c
+++ b/lib/path.c
@@ -1016,7 +1016,12 @@ static int ul_path_cpuparse(struct path_cxt *pc, cpu_set_t **set, int maxcpus, i
goto out;
}
- rc = fgets(buf, len, f) == NULL ? -EIO : 0;
+ if (fgets(buf, len, f) == NULL) {
+ errno = EIO;
+ rc = -errno;
+ } else
+ rc = 0;
+
fclose(f);
if (rc)