Skip to content

Commit

Permalink
Merge remote branch 'origin/master' into fedora/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Schwab committed Nov 30, 2009
2 parents b127b85 + b55ec98 commit 54ff413
Show file tree
Hide file tree
Showing 15 changed files with 239 additions and 65 deletions.
36 changes: 36 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
2009-11-26 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/ptsname.c (__ptsname_internal): Avoid code
only used on truly ancient kernel if configuration requires a more
recent kernel.

2009-11-24 Ulrich Drepper <drepper@redhat.com>

[BZ #3662]
* stdlib/random_r.c: Fix comments for __initstate_r and __setstate_r.
Patch by Christopher Neufeld <glibcbugs0000@cneufeld.ca>.

* sysdeps/unix/grantpt.c (pts_name): Take additional parameter,
pass it on to __ptsname_internal.
(grantpt): Pass stat64 pointer to pts_name. Remove stat call here.
* sysdeps/unix/sysv/linux/ptsname.c (__ptsname_internal): New function.
All the code from __ptsname_r but take additional parameter. Use that
instead of pointer to local stat64 variable.
(__ptsname_r): Call __ptsname_internal with pointer to local stat64
variable.
* include/stdlib.h: Declare __ptsname_internal.

* sysdeps/unix/grantpt.c (grantpt): Use CLOSE_ALL_FDS is available
before the exec.
* sysdeps/unix/sysv/linux/grantpt.c: New file.
* login/programs/pt_chown.c (main): Don't print message on errors
when doing real work.

* sysdeps/unix/grantpt.c (grantpt): Only get tty group information
once.

* csu/elf-init.c (__libc_csu_irel): New function. Code to perform
irel relocations split out from...
(__libc_csu_init): ...here.
* csu/libc-start.c [!SHARED]: Call __libc_csu_irel early.

2009-11-23 Andreas Schwab <schwab@redhat.com>

* sysdeps/unix/sysv/linux/x86_64/bits/stat.h: Use struct timespec
Expand Down
21 changes: 15 additions & 6 deletions csu/elf-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,14 @@ extern void _fini (void);
/* These functions are passed to __libc_start_main by the startup code.
These get statically linked into each program. For dynamically linked
programs, this module will come from libc_nonshared.a and differs from
the libc.a module in that it doesn't call the preinit array. */
the libc.a module in that it doesn't call the preinit array and performs
explicit IREL{,A} relocations. */

void
__libc_csu_init (int argc, char **argv, char **envp)
{
/* For dynamically linked executables the preinit array is executed by
the dynamic linker (before initializing any shared object. */

#ifndef LIBC_NONSHARED
void
__libc_csu_irel (void)
{
# ifdef USE_MULTIARCH
# ifdef ELF_MACHINE_IRELA
{
Expand All @@ -115,7 +114,17 @@ __libc_csu_init (int argc, char **argv, char **envp)
}
# endif
# endif
}
#endif


void
__libc_csu_init (int argc, char **argv, char **envp)
{
/* For dynamically linked executables the preinit array is executed by
the dynamic linker (before initializing any shared object. */

#ifndef LIBC_NONSHARED
/* For static executables, preinit happens right before init. */
{
const size_t size = __preinit_array_end - __preinit_array_start;
Expand Down
6 changes: 6 additions & 0 deletions csu/libc-start.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#include <bp-sym.h>

extern void __libc_init_first (int argc, char **argv, char **envp);
#ifndef SHARED
extern void __libc_csu_irel (void);
#endif

extern int __libc_multiple_libcs;

Expand Down Expand Up @@ -134,6 +137,9 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
}
# endif

/* Performe IREL{,A} relocations. */
__libc_csu_irel ();

/* Initialize the thread library at least a bit since the libgcc
functions are using thread functions if these are available and
we need to setup errno. */
Expand Down
3 changes: 3 additions & 0 deletions include/stdlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/* Now define the internal interfaces. */
#ifndef __Need_M_And_C
# include <sys/stat.h>

__BEGIN_DECLS

Expand Down Expand Up @@ -77,6 +78,8 @@ extern int __clearenv (void);
extern char *__canonicalize_file_name (__const char *__name);
extern char *__realpath (__const char *__name, char *__resolved);
extern int __ptsname_r (int __fd, char *__buf, size_t __buflen);
extern int __ptsname_internal (int fd, char *buf, size_t buflen,
struct stat64 *stp);
extern int __getpt (void);
extern int __posix_openpt (int __oflag);

Expand Down
4 changes: 4 additions & 0 deletions localedata/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2009-11-24 Ulrich Drepper <drepper@redhat.com>

* locales/hsb_DE: Define week, first_weekday, and first_workday.

2009-11-23 Ulrich Drepper <drepper@redhat.com>

* locales/en_DK: Define week, first_weekday, and first_workday.
Expand Down
24 changes: 14 additions & 10 deletions localedata/locales/hsb_DE
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ collating-symbol <SPECIAL>
% letter;accent;case;specials

order_start forward;backward/
;forward;position
;forward;position

% <CAPITAL> or <SMALL> letters first:

Expand Down Expand Up @@ -2136,16 +2136,16 @@ END LC_NUMERIC

LC_TIME
abday "<U004E><U006A>";"<U0050><U00F3>";/
"<U0057><U0075>";"<U0053><U0072>";/
"<U0160><U0074>";"<U0050><U006A>";/
"<U0053><U006F>"
"<U0057><U0075>";"<U0053><U0072>";/
"<U0160><U0074>";"<U0050><U006A>";/
"<U0053><U006F>"
day "<U004E><U006A><U0065><U0064><U017A><U0065><U006C><U0061>";/
"<U0050><U00F3><U006E><U0064><U017A><U0065><U006C><U0061>";/
"<U0057><U0075><U0074><U006F><U0072><U0061>";/
"<U0053><U0072><U006A><U0065><U0064><U0061>";/
"<U0160><U0074><U0076><U00F3><U0072><U0074><U006B>";/
"<U0050><U006A><U0061><U0074><U006B>";/
"<U0053><U006F><U0062><U006F><U0074><U0061>"
"<U0050><U00F3><U006E><U0064><U017A><U0065><U006C><U0061>";/
"<U0057><U0075><U0074><U006F><U0072><U0061>";/
"<U0053><U0072><U006A><U0065><U0064><U0061>";/
"<U0160><U0074><U0076><U00F3><U0072><U0074><U006B>";/
"<U0050><U006A><U0061><U0074><U006B>";/
"<U0053><U006F><U0062><U006F><U0074><U0061>"
abmon "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
"<U004D><U011B><U0072>";"<U0041><U0070><U0072>";/
"<U004D><U0065><U006A>";"<U004A><U0075><U006E>";/
Expand All @@ -2172,6 +2172,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
Expand Down
5 changes: 2 additions & 3 deletions login/programs/pt_chown.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ main (int argc, char *argv[])
# define ncap_list (sizeof (cap_list) / sizeof (cap_list[0]))
cap_t caps = cap_init ();
if (caps == NULL)
error (FAIL_ENOMEM, errno,
_("Failed to initialize drop of capabilities"));
return FAIL_ENOMEM;

/* There is no reason why these should not work. */
cap_set_flag (caps, CAP_PERMITTED, ncap_list, cap_list, CAP_SET);
Expand All @@ -166,7 +165,7 @@ main (int argc, char *argv[])
cap_free (caps);

if (__builtin_expect (res != 0, 0))
error (FAIL_EXEC, errno, _("cap_set_proc failed"));
return FAIL_EXEC;
}
#endif

Expand Down
10 changes: 10 additions & 0 deletions nptl/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2009-11-27 Andreas Schwab <schwab@redhat.com>

* sysdeps/unix/sysv/linux/x86_64/cancellation.S: Reload
THREAD_SELF->cancelhandling after returning from futex call.

2009-11-24 Ulrich Drepper <drepper@redhat.com>

* tst-sem13.c: New file.
* Makefile (tests): Add tst-sem13.

2009-11-22 Roland McGrath <roland@redhat.com>

* sysdeps/unix/sysv/linux/i386/dl-sysdep.h: # include "i686/dl-sysdep.h"
Expand Down
2 changes: 1 addition & 1 deletion nptl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ tests = tst-typesizes \
tst-once1 tst-once2 tst-once3 tst-once4 \
tst-key1 tst-key2 tst-key3 tst-key4 \
tst-sem1 tst-sem2 tst-sem3 tst-sem4 tst-sem5 tst-sem6 tst-sem7 \
tst-sem8 tst-sem9 tst-sem10 tst-sem11 tst-sem12 \
tst-sem8 tst-sem9 tst-sem10 tst-sem11 tst-sem12 tst-sem13 \
tst-barrier1 tst-barrier2 tst-barrier3 tst-barrier4 \
tst-align tst-align2 tst-align3 \
tst-basic1 tst-basic2 tst-basic3 tst-basic4 tst-basic5 tst-basic6 \
Expand Down
5 changes: 3 additions & 2 deletions nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ ENTRY(__pthread_disable_asynccancel)
cmpxchgl %r11d, %fs:CANCELHANDLING
jnz 2b

3: movl %r11d, %eax
andl $(TCB_CANCELING_BITMASK|TCB_CANCELED_BITMASK), %eax
movl %r11d, %eax
3: andl $(TCB_CANCELING_BITMASK|TCB_CANCELED_BITMASK), %eax
cmpl $TCB_CANCELING_BITMASK, %eax
je 4f
1: ret
Expand All @@ -111,5 +111,6 @@ ENTRY(__pthread_disable_asynccancel)
addq $CANCELHANDLING, %rdi
LOAD_PRIVATE_FUTEX_WAIT (%esi)
syscall
movl %fs:CANCELHANDLING, %eax
jmp 3b
END(__pthread_disable_asynccancel)
46 changes: 46 additions & 0 deletions nptl/tst-sem13.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#include <errno.h>
#include <semaphore.h>
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
#include <internaltypes.h>


static int
do_test (void)
{
union
{
sem_t s;
struct new_sem ns;
} u;

if (sem_init (&u.s, 0, 0) != 0)
{
puts ("sem_init failed");
return 1;
}

struct timespec ts = { 0, 1000000001 }; /* Invalid. */
errno = 0;
if (sem_timedwait (&u.s, &ts) >= 0)
{
puts ("sem_timedwait did not fail");
return 1;
}
if (errno != EINVAL)
{
puts ("sem_timedwait did not fail with EINVAL");
return 1;
}
if (u.ns.nwaiters != 0)
{
puts ("nwaiters modified");
return 1;
}

return 0;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
4 changes: 2 additions & 2 deletions stdlib/random_r.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ weak_alias (__srandom_r, srandom_r)
lose this information and will be able to restart with setstate.
Note: The first thing we do is save the current state, if any, just like
setstate so that it doesn't matter when initstate is called.
Returns a pointer to the old state. */
Returns 0 on success, non-zero on failure. */
int
__initstate_r (seed, arg_state, n, buf)
unsigned int seed;
Expand Down Expand Up @@ -296,7 +296,7 @@ weak_alias (__initstate_r, initstate_r)
location into the zeroth word of the state information. Note that due
to the order in which things are done, it is OK to call setstate with the
same state as the current state
Returns a pointer to the old state information. */
Returns 0 on success, non-zero on failure. */
int
__setstate_r (arg_state, buf)
char *arg_state;
Expand Down
Loading

0 comments on commit 54ff413

Please sign in to comment.