Commit 78d7cf92 authored by Andrei Vagin's avatar Andrei Vagin Committed by Pavel Emelyanov

namespace: use ferror() to detect errors of fscanf()

Currently we check errno, but musl-libc doesn't zero it,
if fscanf() has returned EOF without errors.

travis-ci: success for A few fixes for Alpine Linux
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 8e93583d
...@@ -750,8 +750,8 @@ static int parse_id_map(pid_t pid, char *name, UidGidExtent ***pb_exts) ...@@ -750,8 +750,8 @@ static int parse_id_map(pid_t pid, char *name, UidGidExtent ***pb_exts)
ret = fscanf(f, "%d %d %d", &ext->first, ret = fscanf(f, "%d %d %d", &ext->first,
&ext->lower_first, &ext->count); &ext->lower_first, &ext->count);
if (ret != 3) { if (ret != 3) {
if (errno != 0) { if (ferror(f)) {
pr_perror("Unable to parse extents"); pr_perror("Unable to parse extents: %d", ret);
ret = -1; ret = -1;
} else } else
ret = 0; ret = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment