Use pr_perror() on open() failure

It makes sense to show errno to a user.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Kir Kolyshkin 2017-03-23 15:02:02 -07:00 committed by Andrei Vagin
parent 23bdb6173c
commit 6127dd82db

View file

@ -896,7 +896,7 @@ static int prep_unix_sk_cwd(struct unix_sk_info *ui, int *prev_cwd_fd, int *prev
*prev_cwd_fd = open(".", O_RDONLY);
if (*prev_cwd_fd < 0) {
pr_err("Can't open current dir\n");
pr_perror("Can't open current dir");
return -1;
}
@ -905,7 +905,7 @@ static int prep_unix_sk_cwd(struct unix_sk_info *ui, int *prev_cwd_fd, int *prev
root = lookup_ns_by_id(root_item->ids->mnt_ns_id, &mnt_ns_desc);
*prev_root_fd = open("/", O_RDONLY);
if (*prev_root_fd < 0) {
pr_err("Can't open current root\n");
pr_perror("Can't open current root");
goto err;
}