summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2010-05-04 00:21:32 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2010-05-04 00:21:32 +0000
commit7900271c9a94743597a2d3e63c372a8e26fd02e0 (patch)
tree8e878759cc802e1b2a543c32e2b370656e9f9453
parent58799f878e732ac938bc4c714b160b65d6e6bff2 (diff)
Merge changes between r10318 and r10371 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@10372 7b3dc134-2b1b-0410-93df-9e9f96275f8d
-rw-r--r--libc/ChangeLog52
-rw-r--r--libc/elf/chroot_canon.c10
-rw-r--r--libc/elf/dl-close.c5
-rw-r--r--libc/elf/dl-iteratephdr.c11
-rw-r--r--libc/elf/dl-load.c3
-rw-r--r--libc/elf/dl-object.c5
-rw-r--r--libc/elf/dl-support.c4
-rw-r--r--libc/elf/ldconfig.c17
-rw-r--r--libc/elf/rtld.c1
-rw-r--r--libc/hurd/lookup-at.c4
-rw-r--r--libc/include/features.h2
-rw-r--r--libc/localedata/ChangeLog5
-rw-r--r--libc/localedata/locales/de_CH54
-rw-r--r--libc/misc/mntent_r.c6
-rw-r--r--libc/sysdeps/generic/ldsodefs.h4
-rw-r--r--libc/sysdeps/mach/hurd/ttyname_r.c6
-rw-r--r--libc/sysdeps/unix/bsd/ptsname.c11
-rw-r--r--libc/sysdeps/unix/getlogin.c9
-rw-r--r--libc/version.h4
19 files changed, 157 insertions, 56 deletions
diff --git a/libc/ChangeLog b/libc/ChangeLog
index 1de089397..318e77956 100644
--- a/libc/ChangeLog
+++ b/libc/ChangeLog
@@ -1,3 +1,55 @@
+2010-05-03 Ulrich Drepper <drepper@redhat.com>
+
+ * version.h (VERSION): Bump for 2.11 release.
+ * include/features.h (__GLIBC_MINOR__): Bump to 11.
+
+ [BZ #11149]
+ * elf/ldconfig.c (search_dir): Fix handling of symlinks in chroot.
+
+ * elf/chroot_canon.c (chroot_canon): Use xmalloc and xrealloc.
+
+ * elf/ldconfig.c (parse_conf_include): Don't fall back to
+ directories named in config file outside the chroot.
+
+2010-02-02 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/generic/ldsodefs.h (struct rtld_global): Add
+ _dl_load_write_lock.
+ * elf/rtld.c (_rtld_global): Initialize it.
+ * elf/dl-support.c (_dl_load_write_lock): Define .
+ * elf/dl-close.c (_dl_close_worker): Lock GL(dl_load_write_lock)
+ when modifying the list of loaded objects.
+ * elf/dl-load.c (lose): Likewise.
+ * elf/dl-object.c (_dl_new_object): Likewise.
+ * elf/dl-iteratephdr.c (__dl_iterate_phdr): Lock
+ GL(dl_load_write_lock) instead of GL(dl_load_lock).
+
+2010-05-03 Ulrich Drepper <drepper@redhat.com>
+
+ * elf/dl-iteratephdr.c (__dl_iterate_phdr): Remove unnecessary
+ assignment.
+
+2010-05-02 Ulrich Drepper <drepper@redhat.com>
+
+ * misc/mntent_r.c (encode_name): The slow loop handles newlines so we
+ should recognize them as an abort condition.
+ Patch by Jan Lieskovsky <jlieskov@redhat.com>.
+
+2010-04-25 Bruno Haible <bruno@clisp.org>
+
+ [BZ #11538]
+ * sysdeps/unix/bsd/ptsname.c (__ptsname_r): Use __ttyname_r's return
+ value instead of errno.
+ * sysdeps/unix/getlogin.c (getlogin): Likewise.
+
+ [BZ #11537]
+ * sysdeps/mach/hurd/ttyname_r.c (__ttyname_r): Upon failure, return
+ errno, not -1.
+
+2010-04-24 Emilio Pozuelo Monfort <pochu27@gmail.com>
+
+ * hurd/lookup-at.c (__file_name_lookup_at): Fix error return value.
+
2010-04-22 Ulrich Drepper <drepper@redhat.com>
* po/vi.po: Update from translation team.
diff --git a/libc/elf/chroot_canon.c b/libc/elf/chroot_canon.c
index 3c16a43eb..54a6a4cc9 100644
--- a/libc/elf/chroot_canon.c
+++ b/libc/elf/chroot_canon.c
@@ -1,5 +1,5 @@
/* Return the canonical absolute name of a given file inside chroot.
- Copyright (C) 1996,1997,1998,1999,2000,2001,2004,2005
+ Copyright (C) 1996,1997,1998,1999,2000,2001,2004,2005,2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -58,9 +58,7 @@ chroot_canon (const char *chroot, const char *name)
return NULL;
}
- rpath = malloc (chroot_len + PATH_MAX);
- if (rpath == NULL)
- return NULL;
+ rpath = xmalloc (chroot_len + PATH_MAX);
rpath_limit = rpath + chroot_len + PATH_MAX;
@@ -109,9 +107,7 @@ chroot_canon (const char *chroot, const char *name)
new_size += end - start + 1;
else
new_size += PATH_MAX;
- new_rpath = (char *) realloc (rpath, new_size);
- if (new_rpath == NULL)
- goto error;
+ new_rpath = (char *) xrealloc (rpath, new_size);
rpath = new_rpath;
rpath_limit = rpath + new_size;
diff --git a/libc/elf/dl-close.c b/libc/elf/dl-close.c
index 3d14dbe41..f523c3a88 100644
--- a/libc/elf/dl-close.c
+++ b/libc/elf/dl-close.c
@@ -507,6 +507,9 @@ _dl_close_worker (struct link_map *map)
size_t tls_free_end;
tls_free_start = tls_free_end = NO_TLS_OFFSET;
+ /* We modify the list of loaded objects. */
+ __rtld_lock_lock_recursive (GL(dl_load_write_lock));
+
/* Check each element of the search list to see if all references to
it are gone. */
for (unsigned int i = first_loaded; i < nloaded; ++i)
@@ -665,6 +668,8 @@ _dl_close_worker (struct link_map *map)
}
}
+ __rtld_lock_unlock_recursive (GL(dl_load_write_lock));
+
/* If we removed any object which uses TLS bump the generation counter. */
if (any_tls)
{
diff --git a/libc/elf/dl-iteratephdr.c b/libc/elf/dl-iteratephdr.c
index fee19f3f0..5f1c20d75 100644
--- a/libc/elf/dl-iteratephdr.c
+++ b/libc/elf/dl-iteratephdr.c
@@ -1,5 +1,5 @@
/* Get loaded objects program headers.
- Copyright (C) 2001-2004, 2006-2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2001.
@@ -26,7 +26,7 @@
static void
cancel_handler (void *arg __attribute__((unused)))
{
- __rtld_lock_unlock_recursive (GL(dl_load_lock));
+ __rtld_lock_unlock_recursive (GL(dl_load_write_lock));
}
hidden_proto (__dl_iterate_phdr)
@@ -38,8 +38,8 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
struct dl_phdr_info info;
int ret = 0;
- /* Make sure we are alone. */
- __rtld_lock_lock_recursive (GL(dl_load_lock));
+ /* Make sure nobody modifies the list of loaded objects. */
+ __rtld_lock_lock_recursive (GL(dl_load_write_lock));
__libc_cleanup_push (cancel_handler, 0);
/* We have to determine the namespace of the caller since this determines
@@ -68,7 +68,6 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
info.dlpi_phnum = l->l_phnum;
info.dlpi_adds = GL(dl_load_adds);
info.dlpi_subs = GL(dl_load_adds) - nloaded;
- info.dlpi_tls_modid = 0;
info.dlpi_tls_data = NULL;
info.dlpi_tls_modid = l->l_tls_modid;
if (info.dlpi_tls_modid != 0)
@@ -80,7 +79,7 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
/* Release the lock. */
__libc_cleanup_pop (0);
- __rtld_lock_unlock_recursive (GL(dl_load_lock));
+ __rtld_lock_unlock_recursive (GL(dl_load_write_lock));
return ret;
}
diff --git a/libc/elf/dl-load.c b/libc/elf/dl-load.c
index 7ecf82b28..485bd03a7 100644
--- a/libc/elf/dl-load.c
+++ b/libc/elf/dl-load.c
@@ -803,6 +803,8 @@ lose (int code, int fd, const char *name, char *realname, struct link_map *l,
(void) __close (fd);
if (l != NULL)
{
+ /* We modify the list of loaded objects. */
+ __rtld_lock_lock_recursive (GL(dl_load_write_lock));
/* Remove the stillborn object from the list and free it. */
assert (l->l_next == NULL);
if (l->l_prev == NULL)
@@ -813,6 +815,7 @@ lose (int code, int fd, const char *name, char *realname, struct link_map *l,
l->l_prev->l_next = NULL;
--GL(dl_ns)[l->l_ns]._ns_nloaded;
free (l);
+ __rtld_lock_unlock_recursive (GL(dl_load_write_lock));
}
free (realname);
diff --git a/libc/elf/dl-object.c b/libc/elf/dl-object.c
index d3517cecf..fb20b308f 100644
--- a/libc/elf/dl-object.c
+++ b/libc/elf/dl-object.c
@@ -93,6 +93,9 @@ _dl_new_object (char *realname, const char *libname, int type,
new->l_scope = new->l_scope_mem;
new->l_scope_max = sizeof (new->l_scope_mem) / sizeof (new->l_scope_mem[0]);
+ /* We modify the list of loaded objects. */
+ __rtld_lock_lock_recursive (GL(dl_load_write_lock));
+
/* Counter for the scopes we have to handle. */
idx = 0;
@@ -114,6 +117,8 @@ _dl_new_object (char *realname, const char *libname, int type,
new->l_serial = GL(dl_load_adds);
++GL(dl_load_adds);
+ __rtld_lock_unlock_recursive (GL(dl_load_write_lock));
+
/* If we have no loader the new object acts as it. */
if (loader == NULL)
loader = new;
diff --git a/libc/elf/dl-support.c b/libc/elf/dl-support.c
index 198107354..ce507734d 100644
--- a/libc/elf/dl-support.c
+++ b/libc/elf/dl-support.c
@@ -168,6 +168,10 @@ const ElfW(Ehdr) *_dl_sysinfo_dso;
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_initialized_recursive (, _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_initialized_recursive (, _dl_load_write_lock)
#ifdef HAVE_AUX_VECTOR
diff --git a/libc/elf/ldconfig.c b/libc/elf/ldconfig.c
index 74ef7f221..09d6359d8 100644
--- a/libc/elf/ldconfig.c
+++ b/libc/elf/ldconfig.c
@@ -776,7 +776,18 @@ search_dir (const struct dir_entry *entry)
{
/* In case of symlink, we check if the symlink refers to
a directory. */
- if (__builtin_expect (stat64 (real_file_name, &stat_buf), 0))
+ char *target_name = real_file_name;
+ if (opt_chroot)
+ {
+ target_name = chroot_canon (opt_chroot, file_name);
+ if (target_name == NULL)
+ {
+ if (strstr (file_name, ".so") == NULL)
+ error (0, 0, _("Input file %s not found.\n"), file_name);
+ continue;
+ }
+ }
+ if (__builtin_expect (stat64 (target_name, &stat_buf), 0))
{
if (opt_verbose)
error (0, errno, _("Cannot stat %s"), file_name);
@@ -1177,7 +1188,9 @@ parse_conf_include (const char *config_file, unsigned int lineno,
if (do_chroot && opt_chroot)
{
char *canon = chroot_canon (opt_chroot, pattern);
- result = glob64 (canon ?: pattern, 0, NULL, &gl);
+ if (canon == NULL)
+ return;
+ result = glob64 (canon, 0, NULL, &gl);
free (canon);
}
else
diff --git a/libc/elf/rtld.c b/libc/elf/rtld.c
index 58cb41aa8..99af170b6 100644
--- a/libc/elf/rtld.c
+++ b/libc/elf/rtld.c
@@ -126,6 +126,7 @@ struct rtld_global _rtld_global =
._dl_stack_flags = PF_R|PF_W|PF_X,
#ifdef _LIBC_REENTRANT
._dl_load_lock = _RTLD_LOCK_RECURSIVE_INITIALIZER,
+ ._dl_load_write_lock = _RTLD_LOCK_RECURSIVE_INITIALIZER,
#endif
._dl_nns = 1,
._dl_ns =
diff --git a/libc/hurd/lookup-at.c b/libc/hurd/lookup-at.c
index a2d50cb19..7f55527d8 100644
--- a/libc/hurd/lookup-at.c
+++ b/libc/hurd/lookup-at.c
@@ -1,5 +1,5 @@
/* Lookup helper function for Hurd implementation of *at functions.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006,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
@@ -33,7 +33,7 @@ __file_name_lookup_at (int fd, int at_flags,
flags |= (at_flags & AT_SYMLINK_NOFOLLOW) ? O_NOLINK : 0;
at_flags &= ~AT_SYMLINK_NOFOLLOW;
if (at_flags != 0)
- return __hurd_fail (EINVAL);
+ return (__hurd_fail (EINVAL), MACH_PORT_NULL);
if (fd == AT_FDCWD || file_name[0] == '/')
return __file_name_lookup (file_name, flags, mode);
diff --git a/libc/include/features.h b/libc/include/features.h
index 34af792ac..5a06db775 100644
--- a/libc/include/features.h
+++ b/libc/include/features.h
@@ -336,7 +336,7 @@
/* Major and minor version number of the GNU C library package. Use
these macros to test for features in specific releases. */
#define __GLIBC__ 2
-#define __GLIBC_MINOR__ 11
+#define __GLIBC_MINOR__ 12
#define __GLIBC_PREREQ(maj, min) \
((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
diff --git a/libc/localedata/ChangeLog b/libc/localedata/ChangeLog
index e362e2988..514be38cf 100644
--- a/libc/localedata/ChangeLog
+++ b/libc/localedata/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-03 Ulrich Drepper <drepper@redhat.com>
+
+ [BZ #11520]
+ * locales/de_CH: Define week, first_weekday, and first_workday.
+
2010-04-08 Ulrich Drepper <drepper@redhat.com>
* locales/ar_AE: Fix typo.
diff --git a/libc/localedata/locales/de_CH b/libc/localedata/locales/de_CH
index 1ba6585b9..a4cca885b 100644
--- a/libc/localedata/locales/de_CH
+++ b/libc/localedata/locales/de_CH
@@ -84,34 +84,34 @@ END LC_NUMERIC
LC_TIME
% copy "de_DE"
abday "<U0053><U006F><U006E>";"<U004D><U006F><U006E>";/
- "<U0044><U0069><U0065>";"<U004D><U0069><U0074>";/
- "<U0044><U006F><U006E>";"<U0046><U0072><U0065>";/
- "<U0053><U0061><U006D>"
+ "<U0044><U0069><U0065>";"<U004D><U0069><U0074>";/
+ "<U0044><U006F><U006E>";"<U0046><U0072><U0065>";/
+ "<U0053><U0061><U006D>"
day "<U0053><U006F><U006E><U006E><U0074><U0061><U0067>";/
- "<U004D><U006F><U006E><U0074><U0061><U0067>";/
- "<U0044><U0069><U0065><U006E><U0073><U0074><U0061><U0067>";/
- "<U004D><U0069><U0074><U0074><U0077><U006F><U0063><U0068>";/
- "<U0044><U006F><U006E><U006E><U0065><U0072><U0073><U0074><U0061><U0067>";/
- "<U0046><U0072><U0065><U0069><U0074><U0061><U0067>";/
- "<U0053><U0061><U006D><U0073><U0074><U0061><U0067>"
+ "<U004D><U006F><U006E><U0074><U0061><U0067>";/
+ "<U0044><U0069><U0065><U006E><U0073><U0074><U0061><U0067>";/
+ "<U004D><U0069><U0074><U0074><U0077><U006F><U0063><U0068>";/
+ "<U0044><U006F><U006E><U006E><U0065><U0072><U0073><U0074><U0061><U0067>";/
+ "<U0046><U0072><U0065><U0069><U0074><U0061><U0067>";/
+ "<U0053><U0061><U006D><U0073><U0074><U0061><U0067>"
abmon "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
- "<U004D><U00E4><U0072>";"<U0041><U0070><U0072>";/
- "<U004D><U0061><U0069>";"<U004A><U0075><U006E>";/
- "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
- "<U0053><U0065><U0070>";"<U004F><U006B><U0074>";/
- "<U004E><U006F><U0076>";"<U0044><U0065><U007A>"
+ "<U004D><U00E4><U0072>";"<U0041><U0070><U0072>";/
+ "<U004D><U0061><U0069>";"<U004A><U0075><U006E>";/
+ "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
+ "<U0053><U0065><U0070>";"<U004F><U006B><U0074>";/
+ "<U004E><U006F><U0076>";"<U0044><U0065><U007A>"
mon "<U004A><U0061><U006E><U0075><U0061><U0072>";/
- "<U0046><U0065><U0062><U0072><U0075><U0061><U0072>";/
- "<U004D><U00E4><U0072><U007A>";/
- "<U0041><U0070><U0072><U0069><U006C>";/
- "<U004D><U0061><U0069>";/
- "<U004A><U0075><U006E><U0069>";/
- "<U004A><U0075><U006C><U0069>";/
- "<U0041><U0075><U0067><U0075><U0073><U0074>";/
- "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
- "<U004F><U006B><U0074><U006F><U0062><U0065><U0072>";/
- "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
- "<U0044><U0065><U007A><U0065><U006D><U0062><U0065><U0072>"
+ "<U0046><U0065><U0062><U0072><U0075><U0061><U0072>";/
+ "<U004D><U00E4><U0072><U007A>";/
+ "<U0041><U0070><U0072><U0069><U006C>";/
+ "<U004D><U0061><U0069>";/
+ "<U004A><U0075><U006E><U0069>";/
+ "<U004A><U0075><U006C><U0069>";/
+ "<U0041><U0075><U0067><U0075><U0073><U0074>";/
+ "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
+ "<U004F><U006B><U0074><U006F><U0062><U0065><U0072>";/
+ "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
+ "<U0044><U0065><U007A><U0065><U006D><U0062><U0065><U0072>"
d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U0020><U0025><U0054><U0020><U0025><U005A>"
d_fmt "<U0025><U0064><U002E><U0025><U006D><U002E><U0025><U0059>"
t_fmt "<U0025><U0054>"
@@ -120,6 +120,10 @@ t_fmt_ampm ""
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+
+week 7;19971130;4
+first_weekday 2
+first_workday 2
END LC_TIME
LC_PAPER
diff --git a/libc/misc/mntent_r.c b/libc/misc/mntent_r.c
index 829750b39..959852832 100644
--- a/libc/misc/mntent_r.c
+++ b/libc/misc/mntent_r.c
@@ -1,5 +1,5 @@
/* Utilities for reading/writing fstab, mtab, etc.
- Copyright (C) 1995-2000, 2001, 2002, 2003, 2006
+ Copyright (C) 1995-2000, 2001, 2002, 2003, 2006, 2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -194,7 +194,7 @@ weak_alias (__getmntent_r, getmntent_r)
const char *rp = name; \
\
while (*rp != '\0') \
- if (*rp == ' ' || *rp == '\t' || *rp == '\\') \
+ if (*rp == ' ' || *rp == '\t' || *rp == '\n' || *rp == '\\') \
break; \
else \
++rp; \
@@ -202,7 +202,7 @@ weak_alias (__getmntent_r, getmntent_r)
if (*rp != '\0') \
{ \
/* In the worst case the length of the string can increase to \
- founr times the current length. */ \
+ four times the current length. */ \
char *wp; \
\
rp = name; \
diff --git a/libc/sysdeps/generic/ldsodefs.h b/libc/sysdeps/generic/ldsodefs.h
index ff5017e28..ec1e57f88 100644
--- a/libc/sysdeps/generic/ldsodefs.h
+++ b/libc/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/libc/sysdeps/mach/hurd/ttyname_r.c b/libc/sysdeps/mach/hurd/ttyname_r.c
index 7313b9afc..889625224 100644
--- a/libc/sysdeps/mach/hurd/ttyname_r.c
+++ b/libc/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/libc/sysdeps/unix/bsd/ptsname.c b/libc/sysdeps/unix/bsd/ptsname.c
index fd446a4b6..6063201b0 100644
--- a/libc/sysdeps/unix/bsd/ptsname.c
+++ b/libc/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/libc/sysdeps/unix/getlogin.c b/libc/sysdeps/unix/getlogin.c
index b0ad97cfa..1fb70733f 100644
--- a/libc/sysdeps/unix/getlogin.c
+++ b/libc/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/". */
diff --git a/libc/version.h b/libc/version.h
index db60a0c44..02cc48871 100644
--- a/libc/version.h
+++ b/libc/version.h
@@ -1,4 +1,4 @@
/* This file just defines the current version number of libc. */
-#define RELEASE "development"
-#define VERSION "2.11.90"
+#define RELEASE "stable"
+#define VERSION "2.12"