changeset 83:af7cf6f7282c

* ioctl fixes for OS/X
author Chris Cannam
date Mon, 22 Nov 2010 16:02:13 +0000
parents b0a90ac84b8b
children 8a4e26dc3182
files common.cpp
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/common.cpp	Mon Nov 22 15:30:39 2010 +0000
+++ b/common.cpp	Mon Nov 22 16:02:13 2010 +0000
@@ -159,11 +159,11 @@
         DEBUG << "stdin is a terminal, detaching from it" << endl;
         if (ioctl(0, TIOCNOTTY, NULL) < 0) {
             perror("ioctl failed");
-            DEBUG << "ioctl for TIOCNOTTY failed (errno = " << errno << ")" << endl;
+            DEBUG << "ioctl for TIOCNOTTY on stdin failed (errno = " << errno << ")" << endl;
         } else {
-            DEBUG << "ioctl for TIOCNOTTY succeeded" << endl;
+            DEBUG << "ioctl for TIOCNOTTY on stdin succeeded" << endl;
+	    return;
         }
-        return;
     }
 
     int ttyfd = open("/dev/tty", O_RDWR);
@@ -172,11 +172,11 @@
     } else {
         if (ioctl(ttyfd, TIOCNOTTY, NULL) < 0) {
             perror("ioctl failed");
-            DEBUG << "ioctl for TIOCNOTTY failed (errno = " << errno << ")" << endl;
+            DEBUG << "ioctl for TIOCNOTTY on controlling terminal failed (errno = " << errno << ")" << endl;
         } else {
-            DEBUG << "ioctl for TIOCNOTTY succeeded" << endl;
+            DEBUG << "ioctl for TIOCNOTTY on controlling terminal succeeded" << endl;
+	    return;
         }
-        return;
     }
 
 #endif