2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

Make error codes returned being a negative value

We have a mess in our return codes:
some functions return negative values,
while others -- positive.

Sanitize the return codes and make error
condition to return negative values.

Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
Cyrill Gorcunov
2011-12-13 15:03:33 +04:00
parent 093e4f35c3
commit c1350f9ab1
3 changed files with 84 additions and 81 deletions

View File

@@ -318,12 +318,15 @@ int main(int argc, char *argv[])
}
}
if (!log_inited && init_logging(NULL))
return 1;
if (!log_inited) {
ret = init_logging(NULL);
if (ret)
return ret;
}
if (getcwd(image_dir, sizeof(image_dir)) < 0) {
pr_perror("can't get currect directory\n");
return 1;
return -1;
}
switch (action) {