diff options
author | Jakub Jelinek <jakub@redhat.com> | 2004-10-04 08:56:18 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2004-10-04 08:56:18 +0000 |
commit | 85148842d401edf64f9edee7e5819a947c289ed2 (patch) | |
tree | 42f228e998070f60c3bdb2018c9921b221a6851b /fedora | |
parent | 6d96590587deec027c04fe576f11cff0f445eb32 (diff) | |
download | glibc-85148842d401edf64f9edee7e5819a947c289ed2.tar glibc-85148842d401edf64f9edee7e5819a947c289ed2.tar.gz glibc-85148842d401edf64f9edee7e5819a947c289ed2.tar.bz2 glibc-85148842d401edf64f9edee7e5819a947c289ed2.zip |
Updated to fedora-glibc-20041004T0747cvs/fedora-glibc-2_3_3-64
Diffstat (limited to 'fedora')
-rw-r--r-- | fedora/branch.mk | 4 | ||||
-rw-r--r-- | fedora/glibc.spec.in | 15 | ||||
-rw-r--r-- | fedora/glibc_post_upgrade.c | 157 |
3 files changed, 117 insertions, 59 deletions
diff --git a/fedora/branch.mk b/fedora/branch.mk index 748fba0809..5e0abb6fc6 100644 --- a/fedora/branch.mk +++ b/fedora/branch.mk @@ -1,5 +1,5 @@ # This file is updated automatically by Makefile. glibc-branch := fedora glibc-base := HEAD -fedora-sync-date := 2004-10-01 21:34 UTC -fedora-sync-tag := fedora-glibc-20041001T2134 +fedora-sync-date := 2004-10-04 07:47 UTC +fedora-sync-tag := fedora-glibc-20041004T0747 diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in index 7830e73fa2..090a7e4375 100644 --- a/fedora/glibc.spec.in +++ b/fedora/glibc.spec.in @@ -1,4 +1,4 @@ -%define glibcrelease 63 +%define glibcrelease 64 %define auxarches i586 i686 athlon sparcv9 alphaev6 %define prelinkarches noarch %define nptlarches i386 i686 athlon x86_64 ia64 s390 s390x sparcv9 ppc ppc64 @@ -1239,7 +1239,18 @@ rm -f *.filelist* %endif %changelog -* Fri Oct 1 2004 Jakub Jelinek <jakub@redhat.com> 2.3.3-62 +* Mon Oct 4 2004 Jakub Jelinek <jakub@redhat.com> 2.3.3-64 +- update from CVS + - stop using __builtin_expect in assert and assert_perror + (#127606) + - try to avoid too much VA fragmentation with malloc + on flexmap layout (#118574) + - nscd robustification + - change valloc to use debugging hooks (#134385) +- make glibc_post_upgrade more verbose on errors (Fergal Daly, + #125700) + +* Fri Oct 1 2004 Jakub Jelinek <jakub@redhat.com> 2.3.3-63 - update from CVS - fix __nscd_getgrouplist - fix a typo in x86_64 pthread_mutex_timedwait fix diff --git a/fedora/glibc_post_upgrade.c b/fedora/glibc_post_upgrade.c index 095b1ebb32..df151e3cd3 100644 --- a/fedora/glibc_post_upgrade.c +++ b/fedora/glibc_post_upgrade.c @@ -13,10 +13,22 @@ register void *__thread_self __asm ("g7"); #include <string.h> #include <sys/stat.h> -int main(void) +#define verbose_exec(failcode, path...) \ + do \ + { \ + char *const arr[] = { path, NULL }; \ + vexec (failcode, arr); \ + } while (0) + +__attribute__((noinline)) void vexec (int failcode, char *const path[]); +__attribute__((noinline)) void says (const char *str); +__attribute__((noinline)) void sayn (long num); +__attribute__((noinline)) void message (char *const path[]); + +int +main (void) { - pid_t pid; - int status, rerun_ldconfig = 0, rerun_cnt = 0; + int rerun_ldconfig = 0, rerun_cnt = 0; char initpath[256]; #ifdef __i386__ @@ -102,18 +114,7 @@ int main(void) char linkbuf[64], *linkp; int linklen; - pid = vfork (); - if (pid == 0) - { - execl ("/sbin/ldconfig", "/sbin/ldconfig", NULL); - _exit (110); - } - else if (pid < 0) - _exit (111); - if (waitpid (0, &status, 0) != pid || !WIFEXITED (status)) - _exit (112); - if (WEXITSTATUS (status)) - _exit (WEXITSTATUS (status)); + verbose_exec (110, "/sbin/ldconfig", "/sbin/ldconfig"); rerun_ldconfig = 0; #ifdef LIBTLS @@ -150,18 +151,7 @@ int main(void) if (! utimes (GCONV_MODULES_CACHE, NULL)) { - pid = vfork (); - if (pid == 0) - { - execl ("/usr/sbin/iconvconfig", "/usr/sbin/iconvconfig", NULL); - _exit (113); - } - else if (pid < 0) - _exit (114); - if (waitpid (0, &status, 0) != pid || !WIFEXITED (status)) - _exit (115); - if (WEXITSTATUS (status)) - _exit (WEXITSTATUS (status)); + verbose_exec (113, "/usr/sbin/iconvconfig", "/usr/sbin/iconvconfig"); } /* Check if telinit is available and the init fifo as well. */ @@ -173,32 +163,14 @@ int main(void) readlink ("/proc/1/root", initpath, 256) <= 0) _exit (0); - pid = vfork (); - if (pid == 0) - { - execl ("/sbin/telinit", "/sbin/telinit", "u", NULL); - _exit (116); - } - else if (pid < 0) - _exit (117); - if (waitpid (0, &status, 0) != pid || !WIFEXITED (status)) - _exit (118); + verbose_exec (116, "/sbin/telinit", "/sbin/telinit", "u"); /* Check if we can safely condrestart sshd. */ if (access ("/sbin/service", X_OK) == 0 && access ("/usr/sbin/sshd", X_OK) == 0 && access ("/bin/bash", X_OK) == 0) { - pid = vfork (); - if (pid == 0) - { - execl ("/sbin/service", "/sbin/service", "sshd", "condrestart", NULL); - _exit (119); - } - else if (pid < 0) - _exit (120); - if (waitpid (0, &status, 0) != pid || !WIFEXITED (status)) - _exit (121); + verbose_exec (121, "/sbin/service", "/sbin/service", "sshd", "condrestart"); } _exit(0); @@ -213,9 +185,10 @@ pid_t __fork (void) { return -1; } char thr_buf[65536]; #ifndef __powerpc__ -int __libc_start_main (int (*main) (void), int argc, char **argv, - void (*init) (void), void (*fini) (void), - void (*rtld_fini) (void), void * stack_end) +int +__libc_start_main (int (*main) (void), int argc, char **argv, + void (*init) (void), void (*fini) (void), + void (*rtld_fini) (void), void * stack_end) #else struct startup_info { @@ -225,11 +198,11 @@ struct startup_info void (*fini) (void); }; -int __libc_start_main (int argc, char **ubp_av, - char **ubp_ev, - void *auxvec, void (*rtld_fini) (void), - struct startup_info *stinfo, - char **stack_on_entry) +int +__libc_start_main (int argc, char **ubp_av, char **ubp_ev, + void *auxvec, void (*rtld_fini) (void), + struct startup_info *stinfo, + char **stack_on_entry) #endif { #if defined __ia64__ || defined __powerpc64__ @@ -254,3 +227,77 @@ int __libc_start_main (int argc, char **ubp_av, main(); return 0; } + +void +vexec (int failcode, char *const path[]) +{ + pid_t pid; + int status, save_errno; + + pid = vfork (); + if (pid == 0) + { + execv (path[0], path + 1); + save_errno = errno; + message (path); + says (" exec failed with errno "); + sayn (save_errno); + says ("\n"); + _exit (failcode); + } + else if (pid < 0) + { + save_errno = errno; + message (path); + says (" fork failed with errno "); + sayn (save_errno); + says ("\n"); + _exit (failcode + 1); + } + if (waitpid (0, &status, 0) != pid || !WIFEXITED (status)) + { + message (path); + says (" child terminated abnormally\n"); + _exit (failcode + 2); + } + if (WEXITSTATUS (status)) + { + message (path); + says (" child exited with exit code "); + sayn (WEXITSTATUS (status)); + says ("\n"); + _exit (WEXITSTATUS (status)); + } +} + +void +says (const char *str) +{ + write (1, str, strlen (str)); +} + +void +sayn (long num) +{ + char string[sizeof (long) * 3 + 1]; + char *p = string + sizeof (string) - 1; + + *p = '\0'; + if (num == 0) + *--p = '0'; + else + while (num) + { + *--p = '0' + num % 10; + num = num / 10; + } + + says (p); +} + +void +message (char *const path[]) +{ + says ("/usr/sbin/glibc_post_upgrade: While trying to execute "); + says (path[0]); +} |