Skip to contentSkip to conversation

testcase: kernel: ioctl: Handle ENOENT error

PATCH New Mylène Josserand 2 participants 2 messages May 29, 2018 – Jun 5, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 testcase: kernel: ioctl: Handle ENOENT error

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.

---
 testcases/kernel/syscalls/ioctl/ioctl03.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/ioctl/ioctl03.c +1 -1
index 0ae3cb244..b1b50edb4 100644
@@ -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");
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 testcase: kernel: ioctl: Handle ENOENT error

Hi!

Quoted 3 lines

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.

Signature · 2 lines
Cyril Hrubis
[email protected]