svn commit: trunk/uClibc/libc/stdlib

aldot at uclibc.org aldot at uclibc.org
Sun Nov 9 13:13:05 UTC 2008


Author: aldot
Date: 2008-11-09 05:13:05 -0800 (Sun, 09 Nov 2008)
New Revision: 23974

Log:
- for !UNIX98PTY_ONLY we have to fallback to old-style pty's.
  Closes #6024


Modified:
   trunk/uClibc/libc/stdlib/getpt.c


Changeset:
Modified: trunk/uClibc/libc/stdlib/getpt.c
===================================================================
--- trunk/uClibc/libc/stdlib/getpt.c	2008-11-09 13:10:50 UTC (rev 23973)
+++ trunk/uClibc/libc/stdlib/getpt.c	2008-11-09 13:13:05 UTC (rev 23974)
@@ -108,6 +108,11 @@
 	    return -1;
 	}
     }
+#if !defined __UNIX98PTY_ONLY__ && defined __UCLIBC_HAS_GETPT__
+  /* If we have no ptmx then ignore flags and use the fallback.  */
+  if (_state & have_no_dev_ptmx)
+    return __bsd_getpt();
+#endif
   return -1;
 }
 libc_hidden_def(posix_openpt)
@@ -115,18 +120,12 @@
 #undef devpts_mounted
 
 #if defined __USE_GNU && defined __UCLIBC_HAS_GETPT__
-int
-getpt (void)
+int getpt (void)
 {
-	int fd = posix_openpt(O_RDWR);
-#if !defined __UNIX98PTY_ONLY__
-	if (fd == -1)
-		fd = __bsd_getpt();
-#endif
-	return fd;
+	return posix_openpt(O_RDWR);
 }
 
-#if !defined __UNIX98PTY_ONLY__
+#if !defined __UNIX98PTY_ONLY__ && defined __UCLIBC_HAS_GETPT__
 # define PTYNAME1 "pqrstuvwxyzabcde";
 # define PTYNAME2 "0123456789abcdef";
 




More information about the uClibc-cvs mailing list