[CRIU] [PATCH] cgroup: use perror on failed property write

Tycho Andersen tycho.andersen at canonical.com
Fri Mar 4 07:46:26 PST 2016


The errno here is useful information for debugging, we should also print
it.

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 criu/cgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/criu/cgroup.c b/criu/cgroup.c
index 3db6cbd..7c14851 100644
--- a/criu/cgroup.c
+++ b/criu/cgroup.c
@@ -1237,7 +1237,7 @@ static int restore_cgroup_prop(const CgroupPropEntry * cg_prop_entry_p,
 
 	len = strlen(cg_prop_entry_p->value);
 	if (write(fd, cg_prop_entry_p->value, len) != len) {
-		pr_err("Failed writing %s to %s\n", cg_prop_entry_p->value, path);
+		pr_perror("Failed writing %s to %s\n", cg_prop_entry_p->value, path);
 		goto out;
 	}
 
-- 
2.5.0



More information about the CRIU mailing list