mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
cr-check: fix pipe fd leak
fix fdinfo leak. Signed-off-by: Libo Chen <libo.chen@huawei.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
9c88d0cdd8
commit
69ca9aff1e
1 changed files with 8 additions and 3 deletions
11
cr-check.c
11
cr-check.c
|
|
@ -379,18 +379,23 @@ static int check_unaligned_vmsplice(void)
|
|||
ret = pipe(p);
|
||||
if (ret < 0) {
|
||||
pr_perror("Can't create pipe");
|
||||
return -1;
|
||||
return ret;
|
||||
}
|
||||
iov.iov_base = &buf;
|
||||
iov.iov_len = sizeof(buf);
|
||||
ret = vmsplice(p[1], &iov, 1, SPLICE_F_GIFT | SPLICE_F_NONBLOCK);
|
||||
if (ret < 0) {
|
||||
pr_perror("Unaligned vmsplice doesn't work");
|
||||
return -1;
|
||||
goto err;
|
||||
}
|
||||
|
||||
pr_info("Unaligned vmsplice works OK\n");
|
||||
return 0;
|
||||
ret = 0;
|
||||
err:
|
||||
close(p[0]);
|
||||
close(p[1]);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifndef SO_GET_FILTER
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue