Skip to content

Commit

Permalink
Merge pull request #2532 from tcharding/unshare-err
Browse files Browse the repository at this point in the history
usernsexec: Make err out vebose for unshare error
  • Loading branch information
brauner committed Aug 16, 2018
2 parents 3193354 + ede912b commit c5aca61
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lxc/cmd/lxc_usernsexec.c
Expand Up @@ -375,7 +375,8 @@ int main(int argc, char *argv[])

ret = unshare(flags);
if (ret < 0) {
perror("unshare");
fprintf(stderr,
"Failed to unshare mount and user namespace\n");
return 1;
}
buf[0] = '1';
Expand All @@ -399,9 +400,13 @@ int main(int argc, char *argv[])

close(pipe_fds1[1]);
close(pipe_fds2[0]);
if (lxc_read_nointr(pipe_fds1[0], buf, 1) < 1) {
ret = lxc_read_nointr(pipe_fds1[0], buf, 1);
if (ret < 0) {
perror("read pipe");
exit(EXIT_FAILURE);
} else if (ret == 0) {
fprintf(stderr, "Failed to read from pipe\n");
exit(EXIT_FAILURE);
}

buf[0] = '1';
Expand Down

0 comments on commit c5aca61

Please sign in to comment.