[CRIU] [PATCH] fs: Fix retval analysing erratum
Kirill Tkhai
ktkhai at virtuozzo.com
Thu Dec 1 01:04:56 PST 2016
Negative retval is error, while 0 is OK.
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
criu/filesystems.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/criu/filesystems.c b/criu/filesystems.c
index d52fe5c..e640096 100644
--- a/criu/filesystems.c
+++ b/criu/filesystems.c
@@ -213,7 +213,7 @@ static int write_binfmt_misc_entry(char *mp, char *buf, BinfmtMiscEntry *bme)
snprintf(path, PATH_MAX, "%s/%s", mp, bme->name);
fd = open(path, O_WRONLY);
- if (!fd) {
+ if (fd < 0) {
pr_perror("binfmt_misc: can't open %s", path);
goto out;
}
More information about the CRIU
mailing list