aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/getlogin.c5
-rw-r--r--sysdeps/unix/getlogin_r.c5
-rw-r--r--sysdeps/unix/sysv/linux/schedbits.h1
3 files changed, 6 insertions, 5 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. */
diff --git a/sysdeps/unix/getlogin_r.c b/sysdeps/unix/getlogin_r.c
index 15afdee63c..154a9d3a59 100644
--- a/sysdeps/unix/getlogin_r.c
+++ b/sysdeps/unix/getlogin_r.c
@@ -39,7 +39,7 @@ getlogin_r (name, name_len)
char *real_tty_path = tty_pathname;
int result = 0;
struct utmp_data utmp_data;
- struct utmp *ut;
+ struct utmp *ut, line;
{
int err;
@@ -61,7 +61,8 @@ getlogin_r (name, name_len)
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. */
diff --git a/sysdeps/unix/sysv/linux/schedbits.h b/sysdeps/unix/sysv/linux/schedbits.h
deleted file mode 100644
index 7b887aab25..0000000000
--- a/sysdeps/unix/sysv/linux/schedbits.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <linux/posix_sched.h>