summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2010-05-04 12:13:28 -0700
committerRoland McGrath <roland@redhat.com>2010-05-04 12:13:28 -0700
commitbb6d7d23841e57fde2c6c79a4455c7e9373a5d1b (patch)
tree334c4a5d9b11045021021f5f0db53ce4f4fa3ff3 /sysdeps
parent2e76ab2332a7fb9e73a4047625b915bff93bd427 (diff)
parentc4ccff16e2ff92f84102988bd3a32cd1d2719f3a (diff)
Merge commit 'origin/master' into fedora/master
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/ldsodefs.h4
-rw-r--r--sysdeps/mach/hurd/ttyname_r.c6
-rw-r--r--sysdeps/unix/bsd/ptsname.c11
-rw-r--r--sysdeps/unix/getlogin.c9
4 files changed, 22 insertions, 8 deletions
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index a14e8af92f..fcc943bce3 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -416,6 +416,10 @@ struct rtld_global
the loaded object might as well require a call to this function.
At this time it is not anymore a problem to modify the tables. */
__rtld_lock_define_recursive (EXTERN, _dl_load_lock)
+ /* This lock is used to keep __dl_iterate_phdr from inspecting the
+ list of loaded objects while an object is added to or removed
+ from that list. */
+ __rtld_lock_define_recursive (EXTERN, _dl_load_write_lock)
/* Incremented whenever something may have been added to dl_loaded. */
EXTERN unsigned long long _dl_load_adds;
diff --git a/sysdeps/mach/hurd/ttyname_r.c b/sysdeps/mach/hurd/ttyname_r.c
index 7313b9afcb..8896252246 100644
--- a/sysdeps/mach/hurd/ttyname_r.c
+++ b/sysdeps/mach/hurd/ttyname_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 95, 96, 98 Free Software Foundation, Inc.
+/* Copyright (C) 1994,1995,1996,1998,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
@@ -34,13 +34,13 @@ __ttyname_r (int fd, char *buf, size_t buflen)
nodename[0] = '\0';
if (err = HURD_DPORT_USE (fd, __term_get_nodename (port, nodename)))
- return __hurd_dfail (fd, err), -1;
+ return __hurd_dfail (fd, err), errno;
len = strlen (nodename) + 1;
if (len > buflen)
{
errno = EINVAL;
- return -1;
+ return errno;
}
memcpy (buf, nodename, len);
diff --git a/sysdeps/unix/bsd/ptsname.c b/sysdeps/unix/bsd/ptsname.c
index fd446a4b66..6063201b0f 100644
--- a/sysdeps/unix/bsd/ptsname.c
+++ b/sysdeps/unix/bsd/ptsname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1998,2002,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
@@ -44,6 +44,7 @@ int
__ptsname_r (int fd, char *buf, size_t buflen)
{
int save_errno = errno;
+ int err;
struct stat st;
if (buf == NULL)
@@ -62,8 +63,12 @@ __ptsname_r (int fd, char *buf, size_t buflen)
return ERANGE;
}
- if (__ttyname_r (fd, buf, buflen) != 0)
- return errno;
+ err = __ttyname_r (fd, buf, buflen);
+ if (err != 0)
+ {
+ __set_errno (err);
+ return errno;
+ }
buf[sizeof (_PATH_DEV) - 1] = 't';
diff --git a/sysdeps/unix/getlogin.c b/sysdeps/unix/getlogin.c
index b0ad97cfa5..1fb70733fb 100644
--- a/sysdeps/unix/getlogin.c
+++ b/sysdeps/unix/getlogin.c
@@ -38,6 +38,7 @@ getlogin (void)
{
char tty_pathname[2 + 2 * NAME_MAX];
char *real_tty_path = tty_pathname;
+ int err;
char *result = NULL;
struct utmp *ut, line, buffer;
@@ -50,8 +51,12 @@ getlogin (void)
thing to do. Note that ttyname(open("/dev/tty")) on those
systems returns /dev/tty, so that is not a possible solution for
getlogin(). */
- if (__ttyname_r (0, real_tty_path, sizeof (tty_pathname)) != 0)
- return NULL;
+ err = __ttyname_r (0, real_tty_path, sizeof (tty_pathname));
+ if (err != 0)
+ {
+ __set_errno (err);
+ return NULL;
+ }
real_tty_path += 5; /* Remove "/dev/". */