From 42dfe0465e03b819a3508d653ce6e7cc39b40cff Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Fri, 20 Jan 2006 11:38:31 +0000 Subject: Correction if UNIX98PTY_ONLY is not enabled --- libc/stdlib/bsd_getpt.c | 6 ++++-- libc/stdlib/getpt.c | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/libc/stdlib/bsd_getpt.c b/libc/stdlib/bsd_getpt.c index aec0ca4bc..9b885c4e5 100644 --- a/libc/stdlib/bsd_getpt.c +++ b/libc/stdlib/bsd_getpt.c @@ -22,6 +22,8 @@ #include #include +libc_hidden_proto(open) +libc_hidden_proto(mempcpy) /* Prefix for master pseudo terminal nodes. */ #define _PATH_PTY "/dev/pty" @@ -48,7 +50,7 @@ __getpt (void) const char *p, *q; char *s; - s = __mempcpy (buf, _PATH_PTY, sizeof (_PATH_PTY) - 1); + s = mempcpy (buf, _PATH_PTY, sizeof (_PATH_PTY) - 1); /* s[0] and s[1] will be filled in the loop. */ s[2] = '\0'; @@ -62,7 +64,7 @@ __getpt (void) s[1] = *q; - fd = __open (buf, O_RDWR); + fd = open (buf, O_RDWR); if (fd != -1) return fd; diff --git a/libc/stdlib/getpt.c b/libc/stdlib/getpt.c index a5fde0fce..7005bee71 100644 --- a/libc/stdlib/getpt.c +++ b/libc/stdlib/getpt.c @@ -17,12 +17,16 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#define _GNU_SOURCE #include #include #include #include #include +libc_hidden_proto(open) +libc_hidden_proto(close) + #if !defined __ASSUME_DEVPTS__ # include @@ -42,9 +46,6 @@ extern int __bsd_getpt (void) attribute_hidden; #endif -libc_hidden_proto(open) -libc_hidden_proto(close) - /* Open a master pseudo terminal and return its file descriptor. */ int getpt (void) -- cgit v1.2.3