[vte] Bug 569184 - vte generates unnecessary ioctl(I_FIND) kernel warnings



commit 7f2f2f6622e253d6ae623c310bc0be9079ba9cc6
Author: Behdad Esfahbod <behdad behdad org>
Date:   Fri Oct 23 19:12:26 2009 -0400

    Bug 569184 - vte generates unnecessary ioctl(I_FIND) kernel warnings

 src/pty.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/src/pty.c b/src/pty.c
index ea59c5f..4968e6a 100644
--- a/src/pty.c
+++ b/src/pty.c
@@ -206,18 +206,20 @@ vte_pty_child_setup (gpointer arg)
 #endif
 
 #ifdef HAVE_STROPTS_H
-	if ((ioctl(fd, I_FIND, "ptem") == 0) &&
-			(ioctl(fd, I_PUSH, "ptem") == -1)) {
-		_exit (127);
-	}
-	if ((ioctl(fd, I_FIND, "ldterm") == 0) &&
-			(ioctl(fd, I_PUSH, "ldterm") == -1)) {
-		_exit (127);
-	}
-	if ((ioctl(fd, I_FIND, "ttcompat") == 0) &&
-			(ioctl(fd, I_PUSH, "ttcompat") == -1)) {
-		perror ("ioctl (fd, I_PUSH, \"ttcompat\")");
-		_exit (127);
+	if (isastream (fd) == 1) {
+		if ((ioctl(fd, I_FIND, "ptem") == 0) &&
+				(ioctl(fd, I_PUSH, "ptem") == -1)) {
+			_exit (127);
+		}
+		if ((ioctl(fd, I_FIND, "ldterm") == 0) &&
+				(ioctl(fd, I_PUSH, "ldterm") == -1)) {
+			_exit (127);
+		}
+		if ((ioctl(fd, I_FIND, "ttcompat") == 0) &&
+				(ioctl(fd, I_PUSH, "ttcompat") == -1)) {
+			perror ("ioctl (fd, I_PUSH, \"ttcompat\")");
+			_exit (127);
+		}
 	}
 #endif
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]