summaryrefslogtreecommitdiff
path: root/sysdeps/unix/getlogin.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-06-05 03:29:45 +0000
committerRoland McGrath <roland@gnu.org>1996-06-05 03:29:45 +0000
commit58e071515a45fb23bad4298512bb2951fe41dbc5 (patch)
tree7316b76d0f0512bc90f6b6b73c0304a6ecabed33 /sysdeps/unix/getlogin.c
parentee188d555b8c32ad9704a7440cab400af967292f (diff)
* math/Makefile (libm-support, libm-calls): New variables.
(libm-routines): Construct this from those. (calls): New variable. (routines): Construct this from it. * resolv/res_debug.c: Add missing #include <ctype.h>. * sysdeps/unix/getlogin.c: Must pass struct utmp ptr to getutline_r. * sysdeps/unix/getlogin_r.c: Likewise. * sysdeps/libm-ieee754/w_hypotl.c: Fix typo. * sysdeps/libm-ieee754/w_cabsl.c: __cabsl_complex -> __cabs_complexl * math/Makefile (long-m-routines): Define recursive variable as $(long-m-$(long-double-fcts)). (long-m-yes): Put list of routines here. (long-c-routines, long-c-yes): Likewise. * sysdeps/unix/sysv/linux/schedbits.h: File removed. * sysdeps/i386/Makefile (long-double-fcts): New variable, set to yes. * sysdeps/m68k/Makefile: Likewise. * math/Makefile [$(long-double-fcts)!=yes] (CPPFLAGS): Append -DNO_LONG_DOUBLE.
Diffstat (limited to 'sysdeps/unix/getlogin.c')
-rw-r--r--sysdeps/unix/getlogin.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sysdeps/unix/getlogin.c b/sysdeps/unix/getlogin.c
index 00baf6875a..7446f25786 100644
--- a/sysdeps/unix/getlogin.c
+++ b/sysdeps/unix/getlogin.c
@@ -36,7 +36,7 @@ DEFUN_VOID(getlogin)
char *real_tty_path = tty_pathname;
char *result = NULL;
static struct utmp_data utmp_data;
- struct utmp *ut;
+ struct utmp *ut, line;
{
int err = 0;
@@ -58,7 +58,8 @@ DEFUN_VOID(getlogin)
real_tty_path += 5; /* Remove "/dev/". */
setutent_r (&utmp_data);
- if (getutline_r (real_tty_path, &ut, &utmp_data) < 0)
+ strncpy (line.ut_line, real_tty_path, sizeof line.ut_line);
+ if (getutline_r (&line, &ut, &utmp_data) < 0)
{
if (errno == ESRCH)
/* The caller expects ENOENT if nothing is found. */