diff options
author | Roland McGrath <roland@gnu.org> | 1995-12-19 10:00:22 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1995-12-19 10:00:22 +0000 |
commit | 755f55b0dbb0ffadc0acf020123c727dcf558354 (patch) | |
tree | 4c827acefeb58a0b9b3c3def6390a364a951a9bf | |
parent | Sun Dec 17 15:56:35 1995 Miles Bader <miles@gnu.ai.mit.edu> (diff) | |
download | glibc-755f55b0dbb0ffadc0acf020123c727dcf558354.tar.gz glibc-755f55b0dbb0ffadc0acf020123c727dcf558354.tar.bz2 glibc-755f55b0dbb0ffadc0acf020123c727dcf558354.zip |
Mon Dec 18 13:40:37 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>cvs/libc-951219
* stdio/fread.c: Don't increment __offset when it's -1.
* elf/rtld.c (dl_main): Prepend tab to "statically linked". Exit
0 in that case.
* misc/err.c (vwarnx, vwarn): Fix major brainos.
* sysdeps/mach/hurd/dl-sysdep.c (mmap): Fix setting of
inheritance.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | elf/rtld.c | 28 | ||||
-rw-r--r-- | misc/err.c | 22 | ||||
-rw-r--r-- | stdio/fread.c | 9 | ||||
-rw-r--r-- | sysdeps/mach/hurd/dl-sysdep.c | 2 |
5 files changed, 48 insertions, 25 deletions
@@ -1,3 +1,15 @@ +Mon Dec 18 13:40:37 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * stdio/fread.c: Don't increment __offset when it's -1. + + * elf/rtld.c (dl_main): Prepend tab to "statically linked". Exit + 0 in that case. + + * misc/err.c (vwarnx, vwarn): Fix major brainos. + + * sysdeps/mach/hurd/dl-sysdep.c (mmap): Fix setting of + inheritance. + Sun Dec 17 15:56:35 1995 Miles Bader <miles@gnu.ai.mit.edu> * misc/getpass.c (getpass): Don't barf if getline returns a null BUF. diff --git a/elf/rtld.c b/elf/rtld.c index f91ffc77ef..070febc59f 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -301,22 +301,18 @@ of this helper program; chances are you did not intend to run this program.\n", after relocation. */ if (! _dl_loaded->l_info[DT_NEEDED]) - { - _dl_sysdep_message (_dl_loaded->l_name, ": statically linked\n", - NULL); - _exit (1); - } - - for (l = _dl_loaded->l_next; l; l = l->l_next) - { - char buf[20], *bp; - buf[sizeof buf - 1] = '\0'; - bp = _itoa (l->l_addr, &buf[sizeof buf - 1], 16, 0); - while (&buf[sizeof buf - 1] - bp < sizeof l->l_addr * 2) - *--bp = '0'; - _dl_sysdep_message ("\t", l->l_libname, " => ", l->l_name, - " (0x", bp, ")\n", NULL); - } + _dl_sysdep_message ("\t", "statically linked\n", NULL); + else + for (l = _dl_loaded->l_next; l; l = l->l_next) + { + char buf[20], *bp; + buf[sizeof buf - 1] = '\0'; + bp = _itoa (l->l_addr, &buf[sizeof buf - 1], 16, 0); + while (&buf[sizeof buf - 1] - bp < sizeof l->l_addr * 2) + *--bp = '0'; + _dl_sysdep_message ("\t", l->l_libname, " => ", l->l_name, + " (0x", bp, ")\n", NULL); + } _exit (0); } diff --git a/misc/err.c b/misc/err.c index 82719a8756..3ad7bf360f 100644 --- a/misc/err.c +++ b/misc/err.c @@ -20,6 +20,8 @@ Cambridge, MA 02139, USA. */ #include <stdarg.h> #include <err.h> #include <stdlib.h> +#include <errno.h> +#include <string.h> #include <stdio.h> extern char *__progname; @@ -33,18 +35,28 @@ extern char *__progname; } void -vwarn (const char *format, __gnuc_va_list ap) +vwarnx (const char *format, __gnuc_va_list ap) { - fprintf (stderr, format, ap); + if (__progname) + fprintf (stderr, "%s: ", __progname); + if (format) + vfprintf (stderr, format, ap); + putc ('\n', stderr); } void -vwarnx (const char *format, __gnuc_va_list ap) +vwarn (const char *format, __gnuc_va_list ap) { + int error = errno; + if (__progname) fprintf (stderr, "%s: ", __progname); - fprintf (stderr, format, ap); - putc ('\n', stderr); + if (format) + { + vfprintf (stderr, format, ap); + fputs (": ", stderr); + } + fprintf (stderr, "%s\n", strerror (error)); } diff --git a/stdio/fread.c b/stdio/fread.c index 347e8446e1..d2766f6616 100644 --- a/stdio/fread.c +++ b/stdio/fread.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995 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 @@ -95,8 +95,11 @@ DEFUN(fread, (p, size, nmemb, stream), if (count > 0) { to_read -= count; - stream->__offset += count; - stream->__target += count; + if (stream->__offset != -1) + { + stream->__offset += count; + stream->__target += count; + } ptr += count; } else if (count == 0) diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c index a2ffcd2e8c..2d2d360cf2 100644 --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -517,7 +517,7 @@ mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset) (mach_port_t) fd, (vm_offset_t) offset, flags & (MAP_COPY|MAP_PRIVATE), vmprot, VM_PROT_ALL, - (flags & MAP_INHERIT) ? VM_INHERIT_COPY : VM_INHERIT_NONE); + (flags & MAP_SHARED) ? VM_INHERIT_SHARE : VM_INHERIT_COPY); return err ? (caddr_t) __hurd_fail (err) : (caddr_t) mapaddr; } |