summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-08-08 21:34:25 +0000
committerJakub Jelinek <jakub@redhat.com>2005-08-08 21:34:25 +0000
commita6d1003497d92df2575894474fa1d2c0ee3f39f4 (patch)
tree6665a936728da87053845bdff9ff812ee58981ec /sysdeps
parentc633e822b473e8135a36e413c5b79d7ce5a5d1fc (diff)
Updated to fedora-glibc-20050808T2126
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/syslog.c41
-rw-r--r--sysdeps/mach/hurd/mig-reply.c4
-rw-r--r--sysdeps/powerpc/powerpc32/Makefile2
-rw-r--r--sysdeps/powerpc/powerpc64/Makefile6
-rw-r--r--sysdeps/unix/sysv/linux/sigwait.c15
-rw-r--r--sysdeps/x86_64/dl-machine.h19
6 files changed, 52 insertions, 35 deletions
diff --git a/sysdeps/generic/syslog.c b/sysdeps/generic/syslog.c
index 9c8f422aad..9c5597f5aa 100644
--- a/sysdeps/generic/syslog.c
+++ b/sysdeps/generic/syslog.c
@@ -108,32 +108,28 @@ cancel_handler (void *ptr)
* print message on log file; output is intended for syslogd(8).
*/
void
-#if __STDC__
syslog(int pri, const char *fmt, ...)
-#else
-syslog(pri, fmt, va_alist)
- int pri;
- char *fmt;
- va_dcl
-#endif
{
va_list ap;
-#if __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
- vsyslog(pri, fmt, ap);
+ __vsyslog_chk(pri, -1, fmt, ap);
va_end(ap);
}
libc_hidden_def (syslog)
void
-vsyslog(pri, fmt, ap)
- int pri;
- register const char *fmt;
+__syslog_chk(int pri, int flag, const char *fmt, ...)
+{
va_list ap;
+
+ va_start(ap, fmt);
+ __vsyslog_chk(pri, flag, fmt, ap);
+ va_end(ap);
+}
+
+void
+__vsyslog_chk(int pri, int flag, const char *fmt, va_list ap)
{
struct tm now_tm;
time_t now;
@@ -218,7 +214,10 @@ vsyslog(pri, fmt, ap)
/* We have the header. Print the user's format into the
buffer. */
- vfprintf (f, fmt, ap);
+ if (flag == -1)
+ vfprintf (f, fmt, ap);
+ else
+ __vfprintf_chk (f, flag, fmt, ap);
/* Close the memory stream; this will finalize the data
into a malloc'd buffer in BUF. */
@@ -315,6 +314,16 @@ vsyslog(pri, fmt, ap)
if (buf != failbuf)
free (buf);
}
+libc_hidden_def (__vsyslog_chk)
+
+void
+vsyslog(pri, fmt, ap)
+ int pri;
+ register const char *fmt;
+ va_list ap;
+{
+ __vsyslog_chk (pri, -1, fmt, ap);
+}
libc_hidden_def (vsyslog)
static struct sockaddr SyslogAddr; /* AF_UNIX address of local logger */
diff --git a/sysdeps/mach/hurd/mig-reply.c b/sysdeps/mach/hurd/mig-reply.c
index 78bac4bffc..5e40c147b4 100644
--- a/sysdeps/mach/hurd/mig-reply.c
+++ b/sysdeps/mach/hurd/mig-reply.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1994,1995,1996,1997,2005 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
@@ -22,7 +22,7 @@
#define GETPORT \
mach_port_t *portloc = \
(mach_port_t *) __hurd_threadvar_location (_HURD_THREADVAR_MIG_REPLY)
-#define reply_port (use_threadvar ? *portloc : global_reply_port)
+#define reply_port (*(use_threadvar ? portloc : &global_reply_port))
static int use_threadvar;
static mach_port_t global_reply_port;
diff --git a/sysdeps/powerpc/powerpc32/Makefile b/sysdeps/powerpc/powerpc32/Makefile
index 82b4fc95f9..1d58a063d6 100644
--- a/sysdeps/powerpc/powerpc32/Makefile
+++ b/sysdeps/powerpc/powerpc32/Makefile
@@ -21,7 +21,7 @@ ifeq ($(subdir),csu)
ifneq ($(elf),no)
# The initfini generation code doesn't work in the presence of -fPIC, so
# we use -fpic instead which is much better.
-CFLAGS-initfini.s = -g0 -fpic -O1
+CFLAGS-initfini.s += -fpic -O1
# There is no benefit to using sdata for these objects, and the user
# of the library should be able to control what goes into sdata.
diff --git a/sysdeps/powerpc/powerpc64/Makefile b/sysdeps/powerpc/powerpc64/Makefile
index 3ced6568df..cf29148ff3 100644
--- a/sysdeps/powerpc/powerpc64/Makefile
+++ b/sysdeps/powerpc/powerpc64/Makefile
@@ -12,9 +12,9 @@ endif
ifeq ($(subdir),csu)
ifneq ($(elf),no)
-# The initfini generation code doesn't work in the presence of -g1 or
-# higher, so we use -g0.
-CFLAGS-initfini.s = -g0 -fpic -O1
+# The initfini generation code doesn't work in the presence of -fPIC, so
+# we use -fpic instead which is much better.
+CFLAGS-initfini.s += -fpic -O1
endif
endif
diff --git a/sysdeps/unix/sysv/linux/sigwait.c b/sysdeps/unix/sysv/linux/sigwait.c
index 7c865963cd..279ca0203c 100644
--- a/sysdeps/unix/sysv/linux/sigwait.c
+++ b/sysdeps/unix/sysv/linux/sigwait.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1998,2000,2002,2003,2004 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1998,2000,2002-2004,2005 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
@@ -58,8 +58,11 @@ do_sigwait (const sigset_t *set, int *sig)
real size of the user-level sigset_t. */
#ifdef INTERNAL_SYSCALL
INTERNAL_SYSCALL_DECL (err);
- ret = INTERNAL_SYSCALL (rt_sigtimedwait, err, 4, CHECK_SIGSET (set),
- NULL, NULL, _NSIG / 8);
+ do
+ ret = INTERNAL_SYSCALL (rt_sigtimedwait, err, 4, CHECK_SIGSET (set),
+ NULL, NULL, _NSIG / 8);
+ while (INTERNAL_SYSCALL_ERROR_P (ret, err)
+ && INTERNAL_SYSCALL_ERRNO (ret, err) == EINTR);
if (! INTERNAL_SYSCALL_ERROR_P (ret, err))
{
*sig = ret;
@@ -68,8 +71,10 @@ do_sigwait (const sigset_t *set, int *sig)
else
ret = INTERNAL_SYSCALL_ERRNO (ret, err);
#else
- ret = INLINE_SYSCALL (rt_sigtimedwait, 4, CHECK_SIGSET (set),
- NULL, NULL, _NSIG / 8);
+ do
+ ret = INLINE_SYSCALL (rt_sigtimedwait, 4, CHECK_SIGSET (set),
+ NULL, NULL, _NSIG / 8);
+ while (ret == -1 && errno == EINTR);
if (ret != -1)
{
*sig = ret;
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index 335b38ab37..73e271775a 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -55,7 +55,7 @@ elf_machine_dynamic (void)
static inline Elf64_Addr __attribute__ ((unused))
elf_machine_load_address (void)
{
- register Elf64_Addr addr, tmp;
+ Elf64_Addr addr;
/* The easy way is just the same as on x86:
leaq _dl_start, %0
@@ -66,15 +66,18 @@ elf_machine_load_address (void)
Instead we store the address of _dl_start in the data section
and compare it with the current value that we can get via
- an RIP relative addressing mode. */
-
- asm ("movq 1f(%%rip), %1\n"
- "0:\tleaq _dl_start(%%rip), %0\n\t"
- "subq %1, %0\n\t"
- ".section\t.data\n"
+ an RIP relative addressing mode. Note that this is the address
+ of _dl_start before any relocation performed at runtime. In case
+ the binary is prelinked the resulting "address" is actually a
+ load offset which is zero if the binary was loaded at the address
+ it is prelinked for. */
+
+ asm ("leaq _dl_start(%%rip), %0\n\t"
+ "subq 1f(%%rip), %0\n\t"
+ ".section\t.data.rel.ro\n"
"1:\t.quad _dl_start\n\t"
".previous\n\t"
- : "=r" (addr), "=r" (tmp) : : "cc");
+ : "=r" (addr) : : "cc");
return addr;
}