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:
Libo Chen 2013-04-29 16:11:32 +04:00 committed by Pavel Emelyanov
parent 9c88d0cdd8
commit 69ca9aff1e

View file

@ -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