]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
update from main archive 960907
authorUlrich Drepper <drepper@redhat.com>
Sat, 7 Sep 1996 23:56:19 +0000 (23:56 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 7 Sep 1996 23:56:19 +0000 (23:56 +0000)
Sat Sep  7 14:00:33 1996  David Mosberger-Tang  <davidm@azstarnet.com>

* catgets/catgets.c (catopen): Allocate sizeof(*result) bytes
instead of sizeof(nl_catd) (which is just a pointer!).

Sat Sep  7 19:39:19 1996  Ulrich Drepper  <drepper@cygnus.com>

* Makefile ($(objpfx)version-info.h): Generate from Banner files.
* version.c (banner): Add contents of version-info.h to string.

* Makerules: If $($(subdir)-version) is available name versioned
shared library according to this value instead of glibc's version.

* libio/Banner: New file.

* elf/eval.c (funcall): Write error message in case function is
not found.
(eval): Recognize `_' in names.

20 files changed:
ChangeLog
Makefile
Makerules
catgets/catgets.c
elf/eval.c
libio/Banner [new file with mode: 0644]
libio/iofdopen.c
libio/iofopen.c
libio/iofopncook.c
libio/iopopen.c
libio/iovsprintf.c
libio/iovsscanf.c
libio/libio.h
libio/libioP.h
libio/memstream.c
libio/stdfiles.c
libio/vasprintf.c
libio/vdprintf.c
libio/vsnprintf.c
version.c

index dbec91baea4bc42fc993ee15b0c53a80c7995136..ce781aad4ad5a4c6355da62b01b5068ea0077142 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+Sat Sep  7 14:00:33 1996  David Mosberger-Tang  <davidm@azstarnet.com>
+
+       * catgets/catgets.c (catopen): Allocate sizeof(*result) bytes
+       instead of sizeof(nl_catd) (which is just a pointer!).
+
+Sat Sep  7 19:39:19 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * Makefile ($(objpfx)version-info.h): Generate from Banner files.
+       * version.c (banner): Add contents of version-info.h to string.
+
+       * Makerules: If $($(subdir)-version) is available name versioned
+       shared library according to this value instead of glibc's version.
+
+       * libio/Banner: New file.
+
+       * elf/eval.c (funcall): Write error message in case function is
+       not found.
+       (eval): Recognize `_' in names.
+
 Sat Sep  7 05:15:45 1996  Ulrich Drepper  <drepper@cygnus.com>
 
        * libio/iofdopen: Initialize _lock field only if _IO_MTSAFE_IO.
index 039e3c90bd2e830e8e35629899c8aec4301ea357..014b581c452dcaf5f8159c054d93be01dfaed94d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -129,6 +129,23 @@ $(objpfx)sysd-dirs: $(+sysdir_pfx)config.make
         echo endef) > $@-tmp
         mv -f $@-tmp $@
 \f
+$(objpfx)version-info.h: $(..)Makefile $(+sysdir_pfx)config.make
+       (first=yes;                                                           \
+        for dir in $(subdirs); do                                            \
+          if [ -r $$dir/Banner ]; then                                       \
+            if [ $$first = yes ]; then                                       \
+              echo "\"Available extensions:";                                \
+              first=no;                                                      \
+            fi;                                                              \
+            sed -e '/^#/d' -e 's/^[[:space:]]*/        /' $$dir/Banner;    \
+          fi;                                                                \
+        done;                                                                \
+        [ $first = yes ] || echo "\"") > $@-tmp
+        mv -f $@-tmp $@
+
+version.c-objects := $(addprefix $(objpfx)version,$(object-suffixes))
+$(version.c-objects): $(objpfx)version-info.h
+\f
 # Makerules creates a file `stub-$(subdir)' for each subdirectory, which
 # contains `#define __stub_FUNCTION' for each function which is a stub.
 # Here we paste all of these together into <stubs.h>.
index 441e24c34c8a8abb03c84f5b65cbc4d100dbe1b4..740cc0f247721048761a7afbbc3803d78e74719c 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -643,6 +643,7 @@ object-suffixes-left := $(versioned)
 include $(o-iterator)
 
 
+ifeq (,$($(subdir)-version))
 define o-iterator-doit
 $(libdir)/$o$($o-version): $(libdir)/$(o:.so=)-$(version).so; $$(make-link)
 endef
@@ -654,6 +655,21 @@ $(libdir)/$(o:.so=)-$(version).so: $(objpfx)$o; $$(do-install-program)
 endef
 object-suffixes-left := $(versioned)
 include $(o-iterator)
+else
+define o-iterator-doit
+$(libdir)/$o$($o-version): $(libdir)/$(o:.so=)-$($(subdir)-version).so;
+       $$(make-link)
+endef
+object-suffixes-left := $(versioned)
+include $(o-iterator)
+
+define o-iterator-doit
+$(libdir)/$(o:.so=)-$($(subdir)-version).so: $(objpfx)$o;
+       $$(do-install-program)
+endef
+object-suffixes-left := $(versioned)
+include $(o-iterator)
+endif
 endif
 
 define do-install-so
index eae962ffd7af6b2da41c6088374a75bf88ad2486..0abc1824145e792a777fb8666be1e9ae86feab83 100644 (file)
@@ -34,7 +34,7 @@ catopen (const char *cat_name, int flag)
   __nl_catd result;
   const char *env_var;
 
-  result = (__nl_catd) malloc (sizeof (__nl_catd));
+  result = (__nl_catd) malloc (sizeof (*result));
   if (result == NULL)
     /* We cannot get enough memory.  */
     return (nl_catd) -1;
index 91415bb6b61c9a17ec3c3de0f68135ee92252d15..59eb234166a645538389038a26a7a79a1310e2a9 100644 (file)
@@ -1,6 +1,7 @@
 #include <stdio.h>
 #include <ctype.h>
 #include <stdlib.h>
+#include <unistd.h>
 #include <dlfcn.h>
 
 static void *funcall (char **stringp);
@@ -27,6 +28,13 @@ funcall (char **stringp)
     /* Swallow closing paren.  */
     ++*stringp;
 
+  if (args[0] == NULL)
+    {
+      static const char unknown[] = "Unknown function\n";
+      write (1, unknown, sizeof unknown - 1);
+      return NULL;
+    }
+
   /* Do it to it.  */
   __builtin_return (__builtin_apply (args[0],
                                     &argcookie,
@@ -81,7 +89,7 @@ eval (char **stringp)
       value = p;
       do
        ++p;
-      while (*p != '\0' && !isspace (*p) && !ispunct (*p));
+      while (*p != '\0' && !isspace (*p) && (!ispunct (*p) || *p == '_'));
       c = *p;
       *p = '\0';
       value = dlsym (NULL, value);
diff --git a/libio/Banner b/libio/Banner
new file mode 100644 (file)
index 0000000..8ec3141
--- /dev/null
@@ -0,0 +1 @@
+GNU libio by Per Bothner
index c49387b1a0255af000bba5cfa83b2c89b0521347..797192eaae3999e3c84818091858b3b4d5924607 100644 (file)
@@ -42,7 +42,9 @@ _IO_fdopen (fd, mode)
   struct locked_FILE
   {
     struct _IO_FILE_plus fp;
+#ifdef _IO_MTSAFE_IO
     _IO_lock_t lock;
+#endif
   } *new_f;
   int fd_flags;
 
@@ -104,7 +106,9 @@ _IO_fdopen (fd, mode)
   new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
   if (new_f == NULL)
     return NULL;
+#ifdef _IO_MTSAFE_IO
   new_f->fp.file._lock = &new_f->lock;
+#endif
   _IO_init (&new_f->fp.file, 0);
   _IO_JUMPS (&new_f->fp.file) = &_IO_file_jumps;
   _IO_file_init (&new_f->fp.file);
index 334df4652ad9cefffe46fb95a1d7bcc0fe4edcaa..cea24152180d04d4172c81c9ed99f55cf401c02a 100644 (file)
@@ -35,12 +35,16 @@ _IO_fopen (filename, mode)
   struct locked_FILE
   {
     struct _IO_FILE_plus fp;
+#ifdef _IO_MTSAFE_IO
     _IO_lock_t lock;
+#endif
   } *new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
 
   if (new_f == NULL)
     return NULL;
+#ifdef _IO_MTSAFE_IO
   new_f->fp.file._lock = &new_f->lock;
+#endif
   _IO_init (&new_f->fp.file, 0);
   _IO_JUMPS (&new_f->fp.file) = &_IO_file_jumps;
   _IO_file_init (&new_f->fp.file);
index 4193c2447d9b41a1added2d26d182a8209809ae2..718205e073f7d20fadedd94b837e3a12e4d43b7b 100644 (file)
@@ -131,7 +131,9 @@ fopencookie (cookie, mode, io_functions)
   struct locked_FILE
   {
     struct _IO_cookie_file cfile;
+#ifdef _IO_MTSAFE_IO
     _IO_lock_t lock;
+#endif
   } *new_f;
 
   switch (*mode++)
@@ -154,7 +156,9 @@ fopencookie (cookie, mode, io_functions)
   new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
   if (new_f == NULL)
     return NULL;
+#ifdef _IO_MTSAFE_IO
   new_f->cfile.file._lock = &new_f->lock;
+#endif
 
   _IO_init (&new_f->cfile.file, 0);
   _IO_JUMPS (&new_f->cfile.file) = &_IO_cookie_jumps;
index ca2a18edac1cee11a6fe4ad7a274be3aaaf6d504..dc1e74d3eb952d699413dacab08cbd8b74ef7d37 100644 (file)
@@ -152,14 +152,18 @@ DEFUN(_IO_popen, (command, mode),
   struct locked_FILE
   {
     struct _IO_proc_file fpx;
+#ifdef _IO_MTSAFE_IO
     _IO_lock_t lock;
+#endif
   } *new_f;
   _IO_FILE *fp;
 
   new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
   if (new_f == NULL)
     return NULL;
+#ifdef _IO_MTSAFE_IO
   new_f->fpx.file.file._lock = &new_f->lock;
+#endif
   fp = (_IO_FILE*)&new_f->fpx;
   _IO_init(fp, 0);
   _IO_JUMPS(fp) = &_IO_proc_jumps;
index 916804f63d069765d46ceab45d5439804aedb118..b2e8b67a968b6e07754b6ca932ae7474a2f9372c 100644 (file)
@@ -32,10 +32,14 @@ _IO_vsprintf (string, format, args)
       _IO_va_list args;
 {
   _IO_strfile sf;
+#ifdef _IO_MTSAFE_IO
   _IO_lock_t lock;
+#endif
   int ret;
 
+#ifdef _IO_MTSAFE_IO
   sf._f._lock = &lock;
+#endif
   _IO_init ((_IO_FILE *) &sf, 0);
   _IO_JUMPS ((_IO_FILE *) &sf) = &_IO_str_jumps;
   _IO_str_init_static ((_IO_FILE *) &sf, string, -1, string);
index 5b4c7905170628fd790c7d5d0de72f9cba71e1a5..6e7d8c59e2b23d92c2a8f127c83980fefe123982 100644 (file)
@@ -30,8 +30,10 @@ DEFUN(_IO_vsscanf, (string, format, args),
       const char *string AND const char *format AND _IO_va_list args)
 {
   _IO_strfile sf;
+#ifdef _IO_MTSAFE_IO
   _IO_lock_t lock;
   sf._f._lock = &lock;
+#endif
   _IO_init((_IO_FILE*)&sf, 0);
   _IO_JUMPS((_IO_FILE*)&sf) = &_IO_str_jumps;
   _IO_str_init_static ((_IO_FILE*)&sf, (char*)string, 0, NULL);
index 17cef9112189a8331aa4b052eeb420a9128ba9e6..36e839fa32cd63210fe2330c028b8409cc8b3678 100644 (file)
@@ -152,6 +152,7 @@ typedef struct
 #ifdef _IO_MTSAFE_IO
 #include <pthread.h>
 typedef pthread_mutex_t _IO_lock_t;
+#define _IO_lock_init PTHREAD_MUTEX_INITIALIZER
 #else
 typedef void _IO_lock_t;
 #endif
index ac4df17ce85eee566f152d39a93cb3feb6373ea5..f5e6dc5a0ec62f6d252dcd002be00c162122ee23 100644 (file)
@@ -342,10 +342,18 @@ extern int _IO_vscanf __P((const char *, _IO_va_list));
 #else
 #define _IO_FJUMP &_IO_file_jumps,
 #endif
+#ifdef _IO_MTSAFE_IO
 /* check following! */
 #define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \
        { _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
-         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, _IO_FJUMP FD}
+         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, _IO_FJUMP FD, \
+          0, 0, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock }
+#else
+/* check following! */
+#define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \
+       { _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
+          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, _IO_FJUMP FD }
+#endif
 
 /* VTABLE_LABEL defines NAME as of the CLASS class.
    CNLENGTH is strlen(#CLASS).  */
index 1a4f4b9e9669e107c3470bed4ed9df631f18bc08..8f9c8ac92cdeb6ff690b8af7d5761e645fda275b 100644 (file)
@@ -67,14 +67,18 @@ open_memstream (bufloc, sizeloc)
   struct locked_FILE
   {
     struct _IO_FILE_memstream fp;
+#ifdef _IO_MTSAFE_IO
     _IO_lock_t lock;
+#endif
   } *new_f;
   char *buf;
 
   new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
   if (new_f == NULL)
     return NULL;
+#ifdef _IO_MTSAFE_IO
   new_f->fp._sf._f._lock = &new_f->lock;
+#endif
 
   buf = ALLOC_BUF (_IO_BUFSIZ);
   _IO_init (&new_f->fp._sf._f, 0);
index 1d0ef85be90b36090e8860fe5d7d30ac2f490ea5..c50d5f1d8be9fb6b876be0abf08370090b52ce1e 100644 (file)
@@ -31,10 +31,16 @@ the executable file might be covered by the GNU General Public License. */
 
 #include "libioP.h"
 
-
+#ifdef _IO_MTSAFE_IO
+#define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
+  static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_init; \
+  struct _IO_FILE_plus NAME \
+    = {FILEBUF_LITERAL(CHAIN, FLAGS, FD), &_IO_file_jumps}
+#else
 #define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
   struct _IO_FILE_plus NAME \
     = {FILEBUF_LITERAL(CHAIN, FLAGS, FD), &_IO_file_jumps}
+#endif
 
 DEF_STDFILE(_IO_stdin_, 0, 0, _IO_NO_WRITES);
 DEF_STDFILE(_IO_stdout_, 1, &_IO_stdin_.file, _IO_NO_READS);
index cf50603f0dd67b170dad54cfdcf9b4f66c6b34e5..57a3b08ebab8414011bbaaca420a33d69a6c6637 100644 (file)
@@ -38,12 +38,16 @@ _IO_vasprintf (result_ptr, format, args)
   const _IO_size_t init_string_size = 100;
   char *string;
   _IO_strfile sf;
+#ifdef _IO_MTSAFE_IO
   _IO_lock_t lock;
+#endif
   int ret;
   string = ALLOC_BUF(init_string_size);
   if (string == NULL)
     return -1;
+#ifdef _IO_MTSAFE_IO
   sf._f._lock = &lock;
+#endif
   _IO_init((_IO_FILE*)&sf, 0);
   _IO_JUMPS((_IO_FILE*)&sf) = &_IO_str_jumps;
   _IO_str_init_static ((_IO_FILE*)&sf, string, init_string_size, string);
index 8c5833ccbf643488ef97acadcb2341fa33df42e2..b4b1cc337c6539923f85fb557472bc051b948f1b 100644 (file)
@@ -32,10 +32,14 @@ _IO_vdprintf (d, format, arg)
      _IO_va_list arg;
 {
   struct _IO_FILE_plus tmpfil;
+#ifdef _IO_MTSAFE_IO
   _IO_lock_t lock;
+#endif
   int done;
 
+#ifdef _IO_MTSAFE_IO
   tmpfil.file._lock = &lock;
+#endif
   _IO_init (&tmpfil.file, 0);
   _IO_JUMPS (&tmpfil.file) = &_IO_file_jumps;
   _IO_file_init (&tmpfil.file);
index 174640daac6059e367d2c7d6d6b266a4d5bc946b..9f767b5b06a0ad049a9586503053f5567b995a62 100644 (file)
@@ -33,9 +33,11 @@ _IO_vsnprintf (string, maxlen, format, args)
      _IO_va_list args;
 {
   _IO_strfile sf;
-  _IO_lock_t lock;
   int ret;
+#ifdef _IO_MTSAFE_IO
+  _IO_lock_t lock;
   sf._f._lock = &lock;
+#endif
   _IO_init ((_IO_FILE *) &sf, 0);
   _IO_JUMPS ((_IO_FILE *) &sf) = &_IO_str_jumps;
   _IO_str_init_static ((_IO_FILE *) &sf, string, maxlen - 1, string);
index c8f4ec5fe630441b10289a4c4b21bf22de1a802f..a0013984094626af990865ce688d3e1014588999 100644 (file)
--- a/version.c
+++ b/version.c
@@ -26,8 +26,9 @@ Compiled by GNU CC version "__VERSION__".\n\
 Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.\n\
 There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
-PARTICULAR PURPOSE.\n\
-Report bugs to <bug-glibc@gnu.ai.mit.edu>.\n";
+PARTICULAR PURPOSE.\n"
+#include "version-info.h"
+"Report bugs to <bug-glibc@gnu.ai.mit.edu>.\n";
 
 #include <unistd.h>