summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-11-29 20:32:02 -0500
committerMike Frysinger <vapier@gentoo.org>2012-11-29 20:49:18 -0500
commit1d6f6660ffa5303b88c9b7e940b33f2d29e7fb9c (patch)
tree8687145c789bc3ecd869046f7f488258eeeb6114
parent290e19f8147d9b3c0166d3520e718ae5603e4cef (diff)
libc/stdlib: localize __unix_grantpt
When ASSUME_DEVPTS is disabled, we end up exporting __unix_grantpt and get a reloc to it from grantpt. Mark it static to fix all of that. Reported-by: Michael Deutschmann <michael@talamasca.ocis.net> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--libc/stdlib/grantpt.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/libc/stdlib/grantpt.c b/libc/stdlib/grantpt.c
index 187f99333..f80f0946c 100644
--- a/libc/stdlib/grantpt.c
+++ b/libc/stdlib/grantpt.c
@@ -32,25 +32,18 @@
/* Prototype for function that changes ownership and access permission
for slave pseudo terminals that do not live on a `devpts'
filesystem. */
-int __unix_grantpt (int fd);
+static int __unix_grantpt (int fd);
/* Prototype for private function that gets the name of the slave
pseudo terminal in a safe way. */
static int pts_name (int fd, char **pts, size_t buf_len);
extern __typeof(statfs) __libc_statfs;
-#endif
/* Change the ownership and access permission of the slave pseudo
terminal associated with the master pseudo terminal specified
by FD. */
-int
-#if !defined __ASSUME_DEVPTS__
-grantpt (int fd)
-#else
-grantpt (attribute_unused int fd)
-#endif
+int grantpt (int fd)
{
-#if !defined __ASSUME_DEVPTS__
struct statfs fsbuf;
char _buf[PATH_MAX];
char *buf = _buf;
@@ -64,12 +57,19 @@ grantpt (attribute_unused int fd)
/* If the slave pseudo terminal lives on a `devpts' filesystem, the
ownership and access permission are already set. */
if (fsbuf.f_type != DEVPTS_SUPER_MAGIC && fsbuf.f_type != DEVFS_SUPER_MAGIC)
- return __unix_grantpt (fd);
-#endif
+ return __unix_grantpt (fd);
+
return 0;
}
-#if !defined __ASSUME_DEVPTS__
# define grantpt __unix_grantpt
# include "unix_grantpt.c"
+
+#else
+
+int grantpt (attribute_unused int fd)
+{
+ return 0;
+}
+
#endif