[LTP] [PATCH] testcase: kernel: ioctl: Handle ENOENT error

Mylène Josserand mylene.josserand@bootlin.com
Tue May 29 17:53:35 CEST 2018


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(-)

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");
-- 
2.11.0



More information about the ltp mailing list