From 516080bd5d10eb2ce6f8bd0729c3ecb5d2b7dfd5 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Fri, 15 May 2020 17:13:33 -0700 Subject: [PATCH] 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 --- criu/cr-service.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/criu/cr-service.c b/criu/cr-service.c index 6dc2379d6..7c2ff9835 100644 --- a/criu/cr-service.c +++ b/criu/cr-service.c @@ -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)