From cb648fb93462d70dccf07d8d97bb9df6ece0bf16 Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Fri, 30 Aug 2013 16:44:16 +0400 Subject: [PATCH] pie: don't use pr_perror in pie code pr_perror uses errno, which is set by glibc wrappers. In pi return codes of syscalls should be printed Signed-off-by: Andrey Vagin Signed-off-by: Pavel Emelyanov --- pie/util.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pie/util.c b/pie/util.c index 972f4da5e..b495dc35e 100644 --- a/pie/util.c +++ b/pie/util.c @@ -13,19 +13,21 @@ int open_detach_mount(char *dir) { - int fd; + int fd, ret; fd = sys_open(dir, O_RDONLY | O_DIRECTORY, 0); if (fd < 0) - pr_perror("Can't open directory"); + pr_err("Can't open directory %s: %d\n", dir, fd); - if (sys_umount2(dir, MNT_DETACH)) { - pr_perror("Can't detach mount"); + ret = sys_umount2(dir, MNT_DETACH); + if (ret) { + pr_perror("Can't detach mount %s: %d\n", dir, ret); goto err_close; } - if (sys_rmdir(dir)) { - pr_perror("Can't remove tmp dir"); + ret = sys_rmdir(dir); + if (ret) { + pr_perror("Can't remove tmp dir %s: %d\n", dir, ret); goto err_close; }