From 2bf231496fca7698245c7ec35ddaea267c51eaa5 Mon Sep 17 00:00:00 2001 From: Kirill Tkhai Date: Mon, 18 Apr 2016 18:11:00 +0300 Subject: [PATCH] files: Correctly handle tasks with no open file descriptors Do not fail, if task doesn't have open files. This fixes zdtm/static/fd test, which is broken now: (00.004411) Error (cr-dump.c:1312): Dump files (pid: 25) failed with -1 (00.004548) Error (cr-dump.c:1614): Dumping FAILED. Signed-off-by: Kirill Tkhai Acked-by: Cyrill Gorcunov Acked-by: Andrew Vagin Signed-off-by: Pavel Emelyanov --- criu/files.c | 1 + 1 file changed, 1 insertion(+) diff --git a/criu/files.c b/criu/files.c index f02e87a98..67c6721ab 100644 --- a/criu/files.c +++ b/criu/files.c @@ -481,6 +481,7 @@ int dump_task_files_seized(struct parasite_ctl *ctl, struct pstree_item *item, if (!img) goto err; + ret = 0; /* Don't fail if nr_fds == 0 */ for (off = 0; off < dfds->nr_fds; off += nr_fds) { if (nr_fds + off > dfds->nr_fds) nr_fds = dfds->nr_fds - off;