summaryrefslogtreecommitdiff
path: root/libc/sysdeps/unix/getlogin.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/unix/getlogin.c')
-rw-r--r--libc/sysdeps/unix/getlogin.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libc/sysdeps/unix/getlogin.c b/libc/sysdeps/unix/getlogin.c
index 4752685f8..b0ad97cfa 100644
--- a/libc/sysdeps/unix/getlogin.c
+++ b/libc/sysdeps/unix/getlogin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996, 1997, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,16 +25,20 @@
#include <utmp.h>
+static char name[UT_NAMESIZE + 1];
+
/* Return the login name of the user, or NULL if it can't be determined.
The returned pointer, if not NULL, is good only until the next call. */
+#ifdef STATIC
+STATIC
+#endif
char *
getlogin (void)
{
char tty_pathname[2 + 2 * NAME_MAX];
char *real_tty_path = tty_pathname;
char *result = NULL;
- static char name[UT_NAMESIZE + 1];
struct utmp *ut, line, buffer;
/* Get name of tty connected to fd 0. Return NULL if not a tty or