From af0172162f7c653cad6a11ed1c1a5459bc154465 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 14 Jan 2006 00:58:03 +0000 Subject: hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed --- libc/unistd/getlogin.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'libc/unistd/getlogin.c') diff --git a/libc/unistd/getlogin.c b/libc/unistd/getlogin.c index 0747a49f6..f2ee1d355 100644 --- a/libc/unistd/getlogin.c +++ b/libc/unistd/getlogin.c @@ -23,35 +23,40 @@ #include #include +libc_hidden_proto(strcpy) +libc_hidden_proto(strncpy) +libc_hidden_proto(getenv) + /* uClibc makes it policy to not mess with the utmp file whenever * possible, since I consider utmp a complete waste of time. Since * getlogin() should never be used for security purposes, we kindly let * the user specify whatever they want via the LOGNAME environment * variable, or we return NULL if getenv() fails to find anything */ -extern char attribute_hidden * __getlogin(void) +char * getlogin(void) { - return (__getenv("LOGNAME")); + return (getenv("LOGNAME")); } -strong_alias(__getlogin,getlogin) +libc_hidden_proto(getlogin) +libc_hidden_def(getlogin) int getlogin_r(char *name, size_t len) { - char * foo = __getenv("LOGNAME"); + char * foo = getenv("LOGNAME"); if (! foo) return -1; - __strncpy(name, foo, len); + strncpy(name, foo, len); name[len-1] = '\0'; return 0; } char *cuserid(char *s) { - char *name = __getlogin(); + char *name = getlogin(); if (s) { - return(__strcpy(s, name ? name : "")); + return(strcpy(s, name ? name : "")); } return name; } -- cgit v1.2.3