[git commit] getpt.c: no need for hidden posix_openpt

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Fri Jun 15 12:00:36 UTC 2012


commit: http://git.uclibc.org/uClibc/commit/?id=f503f6a97092a349a8de7fac1cde2ef5b3beaf5b
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

Prefer static inline instead of hidden (__bsd_getpt)

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 include/stdlib.h        |    1 -
 libc/stdlib/bsd_getpt.c |    2 +-
 libc/stdlib/getpt.c     |   10 +++++-----
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/include/stdlib.h b/include/stdlib.h
index f0a2169..354fc66 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -864,7 +864,6 @@ extern void setkey (__const char *__key) __THROW __nonnull ((1));
 #ifdef __USE_XOPEN2K
 /* Return a master pseudo-terminal handle.  */
 extern int posix_openpt (int __oflag) __wur;
-libc_hidden_proto(posix_openpt)
 #endif
 
 #ifdef __USE_XOPEN
diff --git a/libc/stdlib/bsd_getpt.c b/libc/stdlib/bsd_getpt.c
index e704e23..d8c46f5 100644
--- a/libc/stdlib/bsd_getpt.c
+++ b/libc/stdlib/bsd_getpt.c
@@ -40,7 +40,7 @@ const char __libc_ptyname1[] attribute_hidden = PTYNAME1;
 const char __libc_ptyname2[] attribute_hidden = PTYNAME2;
 
 /* Open a master pseudo terminal and return its file descriptor.  */
-int
+static __inline__ int
 __getpt (void)
 {
   char buf[sizeof (_PATH_PTY) + 2];
diff --git a/libc/stdlib/getpt.c b/libc/stdlib/getpt.c
index 2d8b207..adebec7 100644
--- a/libc/stdlib/getpt.c
+++ b/libc/stdlib/getpt.c
@@ -43,12 +43,12 @@ extern __typeof(statfs) __libc_statfs;
 
 #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;
+static __inline__ int __bsd_getpt (void);
 #endif
 
 /* Open a master pseudo terminal and return its file descriptor.  */
-int
-posix_openpt (int flags)
+static int
+__posix_openpt (int flags)
 {
 #define have_no_dev_ptmx (1<<0)
 #define devpts_mounted   (1<<1)
@@ -112,14 +112,14 @@ posix_openpt (int flags)
 #endif
   return -1;
 }
-libc_hidden_def(posix_openpt)
+strong_alias(__posix_openpt,posix_openpt)
 #undef have_no_dev_ptmx
 #undef devpts_mounted
 
 #if defined __USE_GNU && defined __UCLIBC_HAS_GETPT__
 int getpt (void)
 {
-	return posix_openpt(O_RDWR);
+	return __posix_openpt(O_RDWR);
 }
 
 #if !defined __UNIX98PTY_ONLY__ && defined __UCLIBC_HAS_GETPT__


More information about the uClibc-cvs mailing list