public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] ANDROID: Fix ioctl03 test for Android
@ 2019-05-06 15:38 Paul Lawrence
  2019-05-06 18:06 ` Steve Muckle
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Lawrence @ 2019-05-06 15:38 UTC (permalink / raw)
  To: ltp

Android has tun file at /dev/tun not /dev/net/tun

Signed-off-by: Paul Lawrence <paullawrence@google.com>
---
 testcases/kernel/syscalls/ioctl/ioctl03.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/testcases/kernel/syscalls/ioctl/ioctl03.c b/testcases/kernel/syscalls/ioctl/ioctl03.c
index b1b50edb4..cc9a2edaf 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl03.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl03.c
@@ -79,6 +79,11 @@ static void verify_features(void)
 	unsigned int features, i;
 
 	int netfd = open("/dev/net/tun", O_RDWR);
+
+	/* Android has tun at /dev/tun */
+	if (netfd == -1 && (errno == ENODEV || errno == ENOENT))
+		netfd = open("/dev/tun", O_RDWR);
+
 	if (netfd == -1) {
 		if (errno == ENODEV || errno == ENOENT)
 			tst_brk(TCONF, "TUN support is missing?");
-- 
2.21.0.1020.gf2820cf01a-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-13 13:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-06 15:38 [LTP] [PATCH] ANDROID: Fix ioctl03 test for Android Paul Lawrence
2019-05-06 18:06 ` Steve Muckle
2019-05-06 20:04   ` Petr Vorel
2019-05-13  9:39     ` Cyril Hrubis
2019-05-13 13:23       ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox