From 21b754921e6ebc7768e408851a7f0475460eb59c Mon Sep 17 00:00:00 2001 From: Joel Nider Date: Mon, 7 May 2018 14:09:06 +0300 Subject: [PATCH] criu/restorer: print valid string when set last_pid fails The string returned by std_vprint_num() is right-aligned in the buffer. Therefore, we must print the string starting from the pointer returned in the 'ps' argument, and not from the start of the original buffer. Signed-off-by: Joel Nider Signed-off-by: Andrei Vagin --- criu/pie/restorer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/criu/pie/restorer.c b/criu/pie/restorer.c index ab0c0d713..69f8504e3 100644 --- a/criu/pie/restorer.c +++ b/criu/pie/restorer.c @@ -1577,7 +1577,7 @@ long __export_restore_task(struct task_restore_args *args) sys_lseek(fd, 0, SEEK_SET); ret = sys_write(fd, s, last_pid_len); if (ret < 0) { - pr_err("Can't set last_pid %ld/%s\n", ret, last_pid_buf); + pr_err("Can't set last_pid %ld/%s\n", ret, s); mutex_unlock(&task_entries_local->last_pid_mutex); sys_close(fd); goto core_restore_end;