Message ID | 20180529155335.5224-1-mylene.josserand@bootlin.com |
---|---|
State | Accepted |
Delegated to: | Petr Vorel |
Headers | show |
Series | testcase: kernel: ioctl: Handle ENOENT error | expand |
Hi! > In case the folder /dev/net is not available, the error > returned is ENOENT and not ENODEV. > Handle this case to return a TCONF instead of a TFAIL. Pushed, thanks.
diff --git a/testcases/kernel/syscalls/ioctl/ioctl03.c b/testcases/kernel/syscalls/ioctl/ioctl03.c index 0ae3cb244..b1b50edb4 100644 --- a/testcases/kernel/syscalls/ioctl/ioctl03.c +++ b/testcases/kernel/syscalls/ioctl/ioctl03.c @@ -80,7 +80,7 @@ static void verify_features(void) int netfd = open("/dev/net/tun", O_RDWR); if (netfd == -1) { - if (errno == ENODEV) + if (errno == ENODEV || errno == ENOENT) tst_brk(TCONF, "TUN support is missing?"); tst_brk(TBROK | TERRNO, "opening /dev/net/tun failed");
In case the folder /dev/net is not available, the error returned is ENOENT and not ENODEV. Handle this case to return a TCONF instead of a TFAIL. Signed-off-by: Mylène Josserand <mylene.josserand@bootlin.com> --- testcases/kernel/syscalls/ioctl/ioctl03.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)