cr-service: spell out an error

While working on runc checkpointing, I incorrectly closed status_fd
prematurely, and received an error from CRIU, but it was
non-descriptive.

Do print the error from open().

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin 2020-05-15 17:13:33 -07:00 committed by Andrei Vagin
parent 65c1be819d
commit 516080bd5d

View file

@ -680,8 +680,10 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
if (req->has_status_fd) {
sprintf(status_fd, "/proc/%d/fd/%d", ids.pid, req->status_fd);
opts.status_fd = open(status_fd, O_WRONLY);
if (opts.status_fd < 0)
if (opts.status_fd < 0) {
pr_perror("Can't reopen status fd %s", status_fd);
goto err;
}
}
if (req->orphan_pts_master)