2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-28 21:07:43 +00:00

net: Dont print error in rule save

This thing is new and can be absent in ip tool, which is OK
and is handled by net.c code itself.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov 2015-11-12 12:15:03 +03:00
parent 336b990995
commit dc00fea333
3 changed files with 6 additions and 3 deletions

View File

@ -172,6 +172,8 @@ extern int is_anon_link_type(char *link, char *type);
extern void *shmalloc(size_t bytes);
extern void shfree_last(void *ptr);
#define CRS_CAN_FAIL 0x1 /* cmd can validly exit with non zero code */
extern int cr_system(int in, int out, int err, char *cmd, char *const argv[], unsigned flags);
extern int cr_system_userns(int in, int out, int err, char *cmd,
char *const argv[], unsigned flags, int userns_pid);

5
net.c
View File

@ -602,7 +602,8 @@ static int run_ip_tool(char *arg1, char *arg2, char *arg3, int fdin, int fdout,
ret = cr_system(fdin, fdout, -1, ip_tool_cmd,
(char *[]) { "ip", arg1, arg2, arg3, NULL }, flags);
if (ret) {
pr_err("IP tool failed on %s %s\n", arg1, arg2);
if (!(flags & CRS_CAN_FAIL))
pr_err("IP tool failed on %s %s\n", arg1, arg2);
return -1;
}
@ -663,7 +664,7 @@ static inline int dump_rule(struct cr_imgset *fds)
if (!path)
return -1;
if (run_ip_tool("rule", "save", NULL, -1, img_raw_fd(img), 0)) {
if (run_ip_tool("rule", "save", NULL, -1, img_raw_fd(img), CRS_CAN_FAIL)) {
pr_warn("Check if \"ip rule save\" is supported!\n");
unlinkat(get_service_fd(IMG_FD_OFF), path, 0);
}

2
util.c
View File

@ -592,7 +592,7 @@ out_chld:
}
if (WIFEXITED(status)) {
if (WEXITSTATUS(status))
if (!(flags & CRS_CAN_FAIL) && WEXITSTATUS(status))
pr_err("exited, status=%d\n", WEXITSTATUS(status));
break;
} else if (WIFSIGNALED(status)) {