Przeglądaj źródła

- revert incorrect parts of r22257 and 22259
since posix_openpt lives in getpt.c it has to stay there unconditionally.

Bernhard Reutner-Fischer 16 lat temu
rodzic
commit
40d3b0ed78
3 zmienionych plików z 6 dodań i 7 usunięć
  1. 1 4
      libc/stdlib/Makefile.in
  2. 2 2
      libc/stdlib/bsd_getpt.c
  3. 3 1
      libc/stdlib/getpt.c

+ 1 - 4
libc/stdlib/Makefile.in

@@ -12,7 +12,7 @@ include $(top_srcdir)libc/stdlib/malloc-standard/Makefile.in
 CSRC := \
 	abort.c getenv.c mkdtemp.c mktemp.c realpath.c mkstemp.c \
 	rand.c random.c random_r.c setenv.c system.c div.c ldiv.c lldiv.c \
-	drand48-iter.c jrand48.c \
+	getpt.c drand48-iter.c jrand48.c \
 	jrand48_r.c lrand48.c lrand48_r.c mrand48.c mrand48_r.c nrand48.c \
 	nrand48_r.c rand_r.c srand48.c srand48_r.c seed48.c seed48_r.c \
 	valloc.c a64l.c l64a.c __uc_malloc.c
@@ -22,9 +22,6 @@ endif
 ifeq ($(UCLIBC_HAS_PTY),y)
 CSRC += grantpt.c unlockpt.c ptsname.c
 endif
-ifeq ($(UCLIBC_HAS_GETPT),y)
-CSRC += getpt.c
-endif
 ifeq ($(UCLIBC_HAS_ARC4RANDOM),y)
 CSRC += arc4random.c
 endif

+ 2 - 2
libc/stdlib/bsd_getpt.c

@@ -22,13 +22,13 @@
 #include <string.h>
 #include <unistd.h>
 
+#if defined __USE_BSD
 libc_hidden_proto(open)
 /* Experimentally off - libc_hidden_proto(mempcpy) */
 
 /* Prefix for master pseudo terminal nodes.  */
 #define _PATH_PTY "/dev/pty"
 
-
 /* Letters indicating a series of pseudo terminals.  */
 #ifndef PTYNAME1
 #define PTYNAME1 "pqrsPQRS"
@@ -41,7 +41,6 @@ const char __libc_ptyname1[] attribute_hidden = PTYNAME1;
 #endif
 const char __libc_ptyname2[] attribute_hidden = PTYNAME2;
 
-
 /* Open a master pseudo terminal and return its file descriptor.  */
 int
 __getpt (void)
@@ -76,3 +75,4 @@ __getpt (void)
   __set_errno (ENOENT);
   return -1;
 }
+#endif /* __USE_BSD */

+ 3 - 1
libc/stdlib/getpt.c

@@ -45,7 +45,7 @@ libc_hidden_proto(close)
 /* Directory containing the UNIX98 pseudo terminals.  */
 #define _PATH_DEVPTS _PATH_DEV "pts"
 
-#if !defined __UNIX98PTY_ONLY__
+#if !defined __UNIX98PTY_ONLY__ && defined __UCLIBC_HAS_GETPT__
 /* Prototype for function that opens BSD-style master pseudo-terminals.  */
 extern int __bsd_getpt (void) attribute_hidden;
 #endif
@@ -106,6 +106,8 @@ posix_openpt (int flags)
     }
   return -1;
 }
+#undef have_no_dev_ptmx
+#undef devpts_mounted
 
 #if defined __USE_GNU && defined __UCLIBC_HAS_GETPT__
 int