Update.
authorUlrich Drepper <drepper@redhat.com>
Tue, 24 Feb 1998 15:22:29 +0000 (15:22 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 24 Feb 1998 15:22:29 +0000 (15:22 +0000)
1998-02-24 15:12  Ulrich Drepper  <drepper@cygnus.com>

* Makeconfig: Filter out frame-pointer effecting options when
compiling profiling or debugging code.
* config.h.in (internal_function): Don't define here if PROF is
defined.
* gmon/gmon.c (__moncontrol): Don't change state if already in error
state.
(__monstartup): If calloc fails set error state and mark array as
not allocated.
(_mcleanup): Don't call write_gmon if in error state.  Don't try
to free array if not  successfully allocated.

* elf/dl-load.c (STRING): Define to __STRING to enble expansion.
Include elf.h to get macro definitions.
Use __ELF?NATIVE?CLASS in message, not __ELF_WORDSIZE.

1998-02-24 09:40  Ulrich Drepper  <drepper@cygnus.com>

* elf/ldd.sh.in: Add compatibility for broken old shells.
* elf/ldd.bash.in: Likewise.

1998-02-24 08:11  H.J. Lu  <hjl@gnu.org>

* sunrpc/rpc_main.c (open_input): Check pipe return error.

* time/clocktest.c (main): Check signal return error.

1998-02-24  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

* iconv/Makefile ($(inst_bindir)/iconv): Correct typo, add
"/" and use do-install-program. Reported by Mark M. Kettenis.
(subdir_install):  Likewise.

1998-02-22  Thorsten Kukuk  <kukuk@vt.uni-paderborn.de>

* sunrpc/rpc_sample.c: Fix typo.

* nscd/connections.c: Use locale.
* nscd/grpcache.c: Add debug messages, gidtbl should get the
  calloc result.
* nscd/nscd.c: Check if init functions fails.
* nscd/nscd_conf.c: Allow disabling of group cache.
* nscd/nscd_getgr_r.c: Fix return code if group not found.
* nscd/pwdcache.c: Fix debug messages.

1998-02-22  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* libc.map: Add __monstartup and _mcleanup for profiling support.

1998-02-20  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* libc.map: Export __getpagesize, for binary compatibility with
2.0.

1998-02-21  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* posix/globtest.sh: Use --library-path instead of
LD_LIBRARY_PATH.
* localedata/sort-test.sh: Likewise.
* localedata/tst-fmon.sh: Likewise.  Avoid useless use of cat.

1998-02-22  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* sysdeps/unix/sysv/linux/sigaction.c: Translate between struct
sigaction and struct kernel_sigaction for __syscall_rt_sigaction.
* sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise.

* sysdeps/unix/sysv/linux/kernel_sigaction.h (struct
kernel_sigaction): Define.
* sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h (struct
kernel_sigaction): Define.

1998-02-23  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

* math/libm-test.c: Change epsilons for libm-ieee754.

1998-02-23 12:33  Ulrich Drepper  <drepper@cygnus.com>

* sysdeps/i386/__longjmp.S: Fix race condition.
Reported by Bruno Haible <haible@ilog.fr>.

22 files changed:
ChangeLog
Makeconfig
config.h.in
elf/dl-load.c
gmon/gmon.c
libc.map
localedata/sort-test.sh
localedata/tst-fmon.sh
math/libm-test.c
nscd/connections.c
nscd/grpcache.c
nscd/nscd.c
nscd/nscd_conf.c
nscd/nscd_getgr_r.c
nscd/pwdcache.c
posix/globtest.sh
sunrpc/rpc_sample.c
sysdeps/i386/__longjmp.S
sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h
sysdeps/unix/sysv/linux/i386/sigaction.c
sysdeps/unix/sysv/linux/kernel_sigaction.h
sysdeps/unix/sysv/linux/sigaction.c

index cb9c484c34bdca58f853dc1ff244580e707d254b..6a636083c1d5a01d08b6f0c13d9a6e469c69b4b5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,85 @@
+1998-02-24 15:12  Ulrich Drepper  <drepper@cygnus.com>
+
+       * Makeconfig: Filter out frame-pointer effecting options when
+       compiling profiling or debugging code.
+       * config.h.in (internal_function): Don't define here if PROF is
+       defined.
+       * gmon/gmon.c (__moncontrol): Don't change state if already in error
+       state.
+       (__monstartup): If calloc fails set error state and mark array as
+       not allocated.
+       (_mcleanup): Don't call write_gmon if in error state.  Don't try
+       to free array if not  successfully allocated.
+
+       * elf/dl-load.c (STRING): Define to __STRING to enble expansion.
+       Include elf.h to get macro definitions.
+       Use __ELF?NATIVE?CLASS in message, not __ELF_WORDSIZE.
+
+1998-02-24 09:40  Ulrich Drepper  <drepper@cygnus.com>
+
+       * elf/ldd.sh.in: Add compatibility for broken old shells.
+       * elf/ldd.bash.in: Likewise.
+
+1998-02-24 08:11  H.J. Lu  <hjl@gnu.org>
+
+       * sunrpc/rpc_main.c (open_input): Check pipe return error.
+
+       * time/clocktest.c (main): Check signal return error.
+
+1998-02-24  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
+
+       * iconv/Makefile ($(inst_bindir)/iconv): Correct typo, add
+       "/" and use do-install-program. Reported by Mark M. Kettenis.
+       (subdir_install):  Likewise.
+
+1998-02-22  Thorsten Kukuk  <kukuk@vt.uni-paderborn.de>
+
+       * sunrpc/rpc_sample.c: Fix typo.
+
+       * nscd/connections.c: Use locale.
+       * nscd/grpcache.c: Add debug messages, gidtbl should get the
+         calloc result.
+       * nscd/nscd.c: Check if init functions fails.
+       * nscd/nscd_conf.c: Allow disabling of group cache.
+       * nscd/nscd_getgr_r.c: Fix return code if group not found.
+       * nscd/pwdcache.c: Fix debug messages.
+
+1998-02-22  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * libc.map: Add __monstartup and _mcleanup for profiling support.
+
+1998-02-20  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * libc.map: Export __getpagesize, for binary compatibility with
+       2.0.
+
+1998-02-21  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * posix/globtest.sh: Use --library-path instead of
+       LD_LIBRARY_PATH.
+       * localedata/sort-test.sh: Likewise.
+       * localedata/tst-fmon.sh: Likewise.  Avoid useless use of cat.
+
+1998-02-22  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * sysdeps/unix/sysv/linux/sigaction.c: Translate between struct
+       sigaction and struct kernel_sigaction for __syscall_rt_sigaction.
+       * sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise.
+
+       * sysdeps/unix/sysv/linux/kernel_sigaction.h (struct
+       kernel_sigaction): Define.
+       * sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h (struct
+       kernel_sigaction): Define.
+
+1998-02-23  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
+
+       * math/libm-test.c: Change epsilons for libm-ieee754.
+
+1998-02-23 12:33  Ulrich Drepper  <drepper@cygnus.com>
+
+       * sysdeps/i386/__longjmp.S: Fix race condition.
+       Reported by Bruno Haible <haible@ilog.fr>.
+
 1998-02-20 18:43  Ulrich Drepper  <drepper@cygnus.com>
 
        * hesiod/hesiod.c: Pretty print.  Don't use __ protected names.
index f4c5573087ddfa634b08cdb836266b433811cf55..b4634cc507358a603e860f2d47a754996cb56db8 100644 (file)
@@ -551,8 +551,8 @@ libio-include = -I$(..)libio
 CPPFLAGS = $(+includes) $(defines) -include $(..)include/libc-symbols.h \
           $(sysdep-CPPFLAGS) $(CPPFLAGS-$(suffix $@)) $(CPPFLAGS-$(<F)) \
           $(CPPFLAGS-$(@F))
-override CFLAGS        = $(+cflags) $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) \
-                 $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
+override CFLAGS        = $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
+                 $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
 
 
 # This is the macro that the implicit linking rules use.
@@ -576,6 +576,7 @@ all-object-suffixes := .o .os .op .og .ob
 object-suffixes :=
 ifeq (yes,$(build-static))
 CPPFLAGS-.o = $(pic-default)
+CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
 libtype.o := lib%.a
 object-suffixes += .o
 endif
@@ -584,7 +585,7 @@ ifeq (yes,$(build-shared))
 # The PIC object files are named foo.os.
 object-suffixes += .os
 CPPFLAGS-.os = -DPIC
-CFLAGS-.os = $(pic-ccflag)
+CFLAGS-.os = $(filter %frame-pointer,$(+cflags)) $(pic-ccflag)
 libtype.os := lib%_pic.a
 # This can be changed by a sysdep makefile
 pic-ccflag = -fPIC
@@ -604,8 +605,8 @@ ifeq (yes,$(build-omitfp))
 object-suffixes += .og
 CPPFLAGS-.og = $(pic-default)
 CFLAGS-.og = -g
-CFLAGS-.o = -g0 -O99 -fomit-frame-pointer -D__USE_STRING_INLINES
-CFLAGS-.os += $(CFLAGS-.o)
+CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) -g0 -O99 -fomit-frame-pointer -D__USE_STRING_INLINES
+CFLAGS-.os += -g0 -O99 -fomit-frame-pointer -D__USE_STRING_INLINES
 libtype.og = lib%_g.a
 endif
 ifeq (yes,$(build-bounded))
index 9e85c7e5cdadcccdfc40139a8b3ed3e56ac1ac23..8cee659dfa4da131ca98d3a68d2d3b38ee2b4ff6 100644 (file)
@@ -66,7 +66,7 @@
 
 /* Defined to some form of __attribute__ ((...)) if the compiler supports
    a different, more efficient calling convention.  */
-#ifdef USE_REGPARMS
+#if defined USE_REGPARMS && !defined PROF
 # define internal_function __attribute__ ((regparm (3), stdcall))
 #endif
 
index c93446a737961d5bdb07379d24d949db47bbed37..7adb6612d02f230f807375ac96c830b210a05faf 100644 (file)
@@ -17,6 +17,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <elf.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <link.h>
@@ -67,7 +68,7 @@
 #define byteorder ELFDATANONE
 #endif
 
-#define STRING(x) #x
+#define STRING(x) __STRING (x)
 
 #ifdef MAP_ANON
 /* The fd is not examined when using MAP_ANON.  */
@@ -561,7 +562,7 @@ _dl_map_object_from_fd (char *name, int fd, char *realname,
 #define ELF32_CLASS ELFCLASS32
 #define ELF64_CLASS ELFCLASS64
   if (header->e_ident[EI_CLASS] != ELFW(CLASS))
-    LOSE ("ELF file class not " STRING(__ELF_WORDSIZE) "-bit");
+    LOSE ("ELF file class not " STRING(__ELF_NATIVE_CLASS) "-bit");
   if (header->e_ident[EI_DATA] != byteorder)
     LOSE ("ELF file data encoding not " byteorder_name);
   if (header->e_ident[EI_VERSION] != EV_CURRENT)
index 787da5a7e7bde9f2796c4f44952305f2dbae34b1..c3e7c51b8cfc886b13d2f0c47046118fe2b58e8c 100644 (file)
@@ -79,6 +79,10 @@ __moncontrol (mode)
 {
   struct gmonparam *p = &_gmonparam;
 
+  /* Don't change the state if we ran into an error.  */
+  if (p->state == GMON_PROF_ERROR)
+    return;
+
   if (mode)
     {
       /* start */
@@ -131,7 +135,9 @@ __monstartup (lowpc, highpc)
   cp = calloc (p->kcountsize + p->fromssize + p->tossize, 1);
   if (! cp)
     {
-      ERR(_("monstartup: out of memory\n"));
+      ERR("monstartup: out of memory\n");
+      p->tos = NULL;
+      p->state = GMON_PROF_ERROR;
       return;
     }
   p->tos = (struct tostruct *)cp;
@@ -350,10 +356,12 @@ weak_alias (__write_profiling, write_profiling)
 void
 _mcleanup (void)
 {
-    __moncontrol (0);
+  __moncontrol (0);
 
+  if (_gmonparam.state != GMON_PROF_ERROR)
     write_gmon ();
 
-    /* free the memory. */
+  /* free the memory. */
+  if (_gmonparam.tos != NULL)
     free (_gmonparam.tos);
 }
index d39fadc0cdda10cccbce5cfe693cb30d562bf9ac..d2e63ec80e4d1203d8b8b0d2a02681de540780ec 100644 (file)
--- a/libc.map
+++ b/libc.map
@@ -45,6 +45,7 @@ GLIBC_2.0 {
     __malloc_initialize_hook; __free_hook; __malloc_hook; __realloc_hook;
     __memalign_hook; __after_morecore_hook;
     __malloc_initialized; __default_morecore; __morecore; __sbrk;
+    __getpagesize;
 
     # functions with required interface outside normal name space
     _exit; __ivaliduser; __open_catalog;
@@ -103,6 +104,9 @@ GLIBC_2.0 {
     __register_frame; __register_frame_table; __deregister_frame;
     __register_frame_info; __deregister_frame_info;
 
+    # Profiling support
+    __monstartup; _mcleanup;
+
     # variables in normal name space
     argp_err_exit_status; argp_program_bug_address; argp_program_version;
     argp_program_version_hook;
index 8f9bb55b72e714b65b87a9710ed317f6c2a9e9e2..affbb26312fb8ae4c597df7f52e4295a22c66a50 100644 (file)
@@ -11,7 +11,7 @@ for l in $lang; do
   cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
   cn=locales/$cns
   fn=charmaps/`echo $l | sed 's/.*[.]\([^.]*\)/\1/'`
-  LD_LIBRARY_PATH=$common_objpfx I18NPATH=./locales ${common_objpfx}elf/ld.so \
+  I18NPATH=./locales ${common_objpfx}elf/ld.so --library-path $common_objpfx \
    ${common_objpfx}locale/localedef --quiet -i $cn -f $fn \
    ${common_objpfx}localedata/$cns
 done
@@ -20,17 +20,17 @@ done
 status=0
 for l in $lang; do
   cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
-  LOCPATH=$common_objpfx/localedata LC_ALL=$cns \
-   LD_LIBRARY_PATH=$common_objpfx $common_objpfx/elf/ld.so \
-   $common_objpfx/localedata/collate-test $id < $cns.in \
-   > $common_objpfx/localedata/$cns.out || status=1
-  cmp -s $cns.in $common_objpfx/localedata/$cns.out || status=1
+  LOCPATH=${common_objpfx}localedata LC_ALL=$cns \
+   ${common_objpfx}elf/ld.so --library-path $common_objpfx \
+   ${common_objpfx}localedata/collate-test $id < $cns.in \
+   > ${common_objpfx}localedata/$cns.out || status=1
+  cmp -s $cns.in ${common_objpfx}localedata/$cns.out || status=1
 
-  LOCPATH=$common_objpfx/localedata LC_ALL=$cns \
-   LD_LIBRARY_PATH=$common_objpfx $common_objpfx/elf/ld.so \
-   $common_objpfx/localedata/xfrm-test $id < $cns.in \
-   > $common_objpfx/localedata/$cns.xout || status=1
-  cmp -s $cns.in $common_objpfx/localedata/$cns.xout || status=1
+  LOCPATH=${common_objpfx}localedata LC_ALL=$cns \
+   ${common_objpfx}elf/ld.so --library-path $common_objpfx \
+   ${common_objpfx}localedata/xfrm-test $id < $cns.in \
+   > ${common_objpfx}localedata/$cns.xout || status=1
+  cmp -s $cns.in ${common_objpfx}localedata/$cns.xout || status=1
 done
 
 exit $status
index aadc40cbf669075b584478b4b9ad0daabc67c501..4192a405d6e6f950c7f275ac62fa84f69178a0c3 100755 (executable)
@@ -32,19 +32,19 @@ for l in $lang; do
     cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
     cn=locales/$cns
     fn=charmaps/`echo $l | sed 's/.*[.]\([^.]*\)/\1/'`
-    LD_LIBRARY_PATH=$common_objpfx I18NPATH=./locales \
-    ${common_objpfx}elf/ld.so ${common_objpfx}locale/localedef \
+    I18NPATH=./locales \
+    ${common_objpfx}elf/ld.so --library-path $common_objpfx \
+    ${common_objpfx}locale/localedef \
     --quiet -i $cn -f $fn ${common_objpfx}localedata/$cns
 done
 
 # Run the tests.
 IFS="  "                # This is a TAB
-cat $datafile |
 while read locale format value expect; do
     if [ -n "$format" ]; then
        LOCPATH=${common_objpfx}localedata \
-       LD_LIBRARY_PATH=$common_objpfx \
-       ${common_objpfx}elf/ld.so ${common_objpfx}localedata/tst-fmon \
+       ${common_objpfx}elf/ld.so --library-path $common_objpfx \
+        ${common_objpfx}localedata/tst-fmon \
            "$locale" "$format" "$value" "$expect"
        if [ $? -eq 0 ]; then
            if [ $DEBUG -eq 1 ]; then
@@ -57,7 +57,7 @@ while read locale format value expect; do
            exit 1
        fi
     fi
-done
+done < $datafile
 
 exit $?
 # Local Variables:
index ea5716ff81ff6e46838c20e92f2c8ddeab6a46c2..7093fdcf14df2bd1a1670c58dd46892478bd30f8 100644 (file)
@@ -902,7 +902,7 @@ asin_test (void)
   check ("asin (1.0) ==  pi/2", FUNC(asin) (1.0), M_PI_2l);
   check ("asin (-1.0) ==  -pi/2", FUNC(asin) (-1.0), -M_PI_2l);
   check_eps ("asin (0.7) ==  0.775397496...", FUNC(asin) (0.7),
-            0.7753974966107530637L, CHOOSE(7e-17L, 2e-16, 0));
+            0.7753974966107530637L, CHOOSE(7e-17L, 2e-16, 2e-7));
 }
 
 
@@ -917,7 +917,7 @@ asinh_test (void)
   check_isinfn ("asinh(-inf) == -inf", FUNC(asinh) (minus_infty));
 #endif
   check_eps ("asinh(0.7) == 0.652666566...", FUNC(asinh) (0.7),
-            0.652666566082355786L, CHOOSE(4e-17L, 0, 0));
+            0.652666566082355786L, CHOOSE(4e-17L, 0, 6e-8));
 
 }
 
@@ -1945,7 +1945,7 @@ tanh_test (void)
   check ("tanh (-inf) == -1", FUNC(tanh) (minus_infty), -1);
 #endif
   check_eps ("tanh (0.7) == 0.6043677771...", FUNC(tanh) (0.7),
-            0.60436777711716349631L, CHOOSE(3e-17L, 0, 0));
+            0.60436777711716349631L, CHOOSE(3e-17L, 0, 6e-8));
 }
 
 
@@ -2708,7 +2708,7 @@ cexp_test (void)
 
   result = FUNC(cexp) (BUILD_COMPLEX (0.7, 1.2));
   check_eps ("real(cexp(0.7 + i 1.2)) == 0.72969...", __real__ result,
-            0.7296989091503236012L, CHOOSE(6e-17L, 0, 2e-7));
+            0.7296989091503236012L, CHOOSE(6e-17L, 2e-16, 2e-7));
   check_eps ("imag(cexp(0.7 + i 1.2)) == 1.87689...", __imag__ result,
             1.8768962328348102821L, CHOOSE(2e-16L, 0, 3e-7));
 
@@ -4603,9 +4603,9 @@ ctanh_test (void)
 
   result = FUNC(ctanh) (BUILD_COMPLEX (0.7, 1.2));
   check_eps ("real(ctanh(0.7 + i 1.2)) == 1.34721...", __real__ result,
-            1.3472197399061191630L, CHOOSE(4e-17L, 6e-17, 2e-7));
+            1.3472197399061191630L, CHOOSE(4e-17L, 3e-16, 2e-7));
   check_eps ("imag(ctanh(0.7 + i 1.2)) == -0.47786...", __imag__ result,
-            0.4778641038326365540L, CHOOSE(9e-17L, 6e-17, 0));
+            0.4778641038326365540L, CHOOSE(9e-17L, 6e-17, 9e-8));
 
   result = FUNC(ctanh) (BUILD_COMPLEX (-2, -3));
   check_eps ("real(ctanh(-2 - i 3)) == -0.96538...", __real__ result,
index abde747a8aa01a78284f31177afe9359bd204db7..36e89fa25dfe57ee6424b33af096a3f2e8945cb0 100644 (file)
@@ -393,7 +393,7 @@ pw_send_disabled (int conn)
 
   if (sock[conn] == 0)
     {
-      dbg_log ("bad connection id on send response [%d|%d]",
+      dbg_log (_("bad connection id on send response [%d|%d]"),
               conn, sock[conn]);
       return;
     }
index 9734d08510c9dbd27f383cec6e62c25abedbd796..2b837f8bc1b0e681519eee4fcdae0296f204a714 100644 (file)
@@ -109,7 +109,7 @@ cache_grpinit ()
   grptbl = calloc (modulo, sizeof (grphash));
   if (grptbl == NULL)
     return -1;
-  calloc (modulo, sizeof (grphash));
+  gidtbl = calloc (modulo, sizeof (grphash));
   if (gidtbl == NULL)
     return -1;
   negtbl = calloc (modulo, sizeof (neghash));
@@ -179,6 +179,9 @@ add_cache (struct group *grp)
   unsigned long int hash = __nis_hash (grp->gr_name,
                                       strlen (grp->gr_name)) % modulo;
 
+  if (debug_flag)
+    dbg_log (_("grp_add_cache (%s)"), grp->gr_name);
+
   work = &grptbl[hash];
 
   if (grptbl[hash].grp == NULL)
@@ -244,10 +247,16 @@ add_negcache (char *key)
   neghash *work;
   unsigned long int hash = __nis_hash (key, strlen (key)) % modulo;
 
+  if (debug_flag)
+    dbg_log (_("grp_add_netgache (%s|%ld)"), key, hash);
+
   work = &negtbl[hash];
 
   if (negtbl[hash].key == NULL)
-    negtbl[hash].key = strdup (key);
+    {
+      negtbl[hash].key = strdup (key);
+      negtbl[hash].next = NULL;
+    }
   else
     {
       while (work->next != NULL)
@@ -268,6 +277,9 @@ cache_search_neg (const char *key)
   neghash *work;
   unsigned long int hash = __nis_hash (key, strlen (key)) % modulo;
 
+  if (debug_flag)
+    dbg_log (_("grp_cache_search_neg (%s|%ld)"), key, hash);
+
   work = &negtbl[hash];
 
   while (work->key != NULL)
@@ -286,7 +298,7 @@ void *
 cache_getgrnam (void *v_param)
 {
   param_t *param = (param_t *)v_param;
-  struct group *grp, resultbuf;
+  struct group *grp;
 
   pthread_rwlock_rdlock (&grplock);
   grp = cache_search_name (param->key);
@@ -294,7 +306,7 @@ cache_getgrnam (void *v_param)
   /* I don't like it to hold the read only lock longer, but it is
      necessary to avoid to much malloc/free/strcpy.  */
 
-  if (grp)
+  if (grp != NULL)
     {
       if (debug_flag)
        dbg_log (_("Found \"%s\" in cache !"), param->key);
@@ -307,9 +319,10 @@ cache_getgrnam (void *v_param)
     }
   else
     {
+      int status;
       int buflen = 1024;
       char *buffer = calloc (1, buflen);
-      int status;
+      struct group resultbuf;
 
       if (debug_flag)
        dbg_log (_("Doesn't found \"%s\" in cache !"), param->key);
@@ -371,6 +384,9 @@ cache_gr_disabled (void *v_param)
 {
   param_t *param = (param_t *)v_param;
 
+  if (debug_flag)
+    dbg_log (_("\tgroup cache is disabled\n"));
+
   gr_send_disabled (param->conn);
   return NULL;
 }
index 7e0b32ae1974e87c889b0c94a60eb36f2e9e42eb..a53abc1fe0cf41076a2fea1a98b902656527f28e 100644 (file)
@@ -107,7 +107,7 @@ main (int argc, char **argv)
   /* Parse and process arguments.  */
   argp_parse (&argp, argc, argv, 0, &remaining, NULL);
 
-  if (remaining != 0)
+  if (remaining != argc)
     {
       error (0, 0, gettext ("wrong number of arguments"));
       argp_help (&argp, stdout, ARGP_HELP_SEE, program_invocation_short_name);
@@ -152,8 +152,11 @@ main (int argc, char **argv)
   /* Create first sockets */
   init_sockets ();
   /* Init databases */
-  cache_pwdinit ();
-  cache_grpinit ();
+  if ((cache_pwdinit () < 0) || (cache_grpinit () < 0))
+    {
+      fputs (_("Not enough memory\n"), stderr);
+      return 1;
+    }
   /* Handle incoming requests */
   handle_requests ();
 
index 59c225e56627fa7302d6f637473bcbc365b5902e..62a1e6cbd180ddef96740b202e67b1be7d2ecb99 100644 (file)
@@ -122,6 +122,11 @@ nscd_parse_file (const char *fname)
          if (strcmp (arg1, "passwd") == 0
              && strcmp (arg2, "no") == 0)
            disabled_passwd = 1;
+         else if (strcmp (arg1, "group") == 0
+                  && strcmp (arg2, "no") == 0)
+           disabled_group = 1;
+         else
+           dbg_log (_("service %s is not supported"), arg1);
        }
       else if (strcmp (entry, "logfile") == 0)
        {
index 6739657e48c809a053512ed1b450dccd932da2d9..f133530f9f12403ee5a200e546207c311fd4d275 100644 (file)
@@ -205,7 +205,12 @@ __nscd_getgr_r (const char *key, request_type type, struct group *resultbuf,
              return 1;
            }
        }
+      close (sock);
+      return 0;
+    }
+  else
+    {
+      close (sock);
+      return -1;
     }
-  close (sock);
-  return 0;
 }
index 82a26efc2581f5d6fa2ada4f540311359b37c03c..721e77b7c9367d60a372cf0a5231bbc4cc9c54b8 100644 (file)
@@ -163,7 +163,7 @@ add_cache (struct passwd *pwd)
                                       strlen (pwd->pw_name)) % modulo;
 
   if (debug_flag)
-    dbg_log (_("add_cache (%s)"), pwd->pw_name);
+    dbg_log (_("pwd_add_cache (%s)"), pwd->pw_name);
 
   work = &pwdtbl[hash];
 
@@ -231,7 +231,7 @@ add_negcache (char *key)
   unsigned long int hash = __nis_hash (key, strlen (key)) % modulo;
 
   if (debug_flag)
-    dbg_log (_("add_netgache (%s|%ld)"), key, hash);
+    dbg_log (_("pwd_add_netgache (%s|%ld)"), key, hash);
 
   work = &negtbl[hash];
 
@@ -249,7 +249,7 @@ add_negcache (char *key)
       work->next->key = strdup (key);
       work = work->next;
     }
-  /* Set a pointer from the pwuid hash table to the pwname hash table */
+
   time (&work->create);
 
   return 0;
@@ -261,10 +261,10 @@ cache_search_neg (const char *key)
   neghash *work;
   unsigned long int hash = __nis_hash (key, strlen (key)) % modulo;
 
-  work = &negtbl[hash];
-
   if (debug_flag)
-    dbg_log (_("cache_search_neg (%s|%ld)"), key, hash);
+    dbg_log (_("pwd_cache_search_neg (%s|%ld)"), key, hash);
+
+  work = &negtbl[hash];
 
   while (work->key != NULL)
     {
@@ -281,8 +281,8 @@ cache_search_neg (const char *key)
 void *
 cache_getpwnam (void *v_param)
 {
+  struct passwd *pwd;
   param_t *param = (param_t *)v_param;
-  struct passwd *pwd, resultbuf;
 
   pthread_rwlock_rdlock (&pwdlock);
   pwd = cache_search_name (param->key);
@@ -300,13 +300,13 @@ cache_getpwnam (void *v_param)
       close_socket (param->conn);
 
       pthread_rwlock_unlock (&pwdlock);
-      pwd = &resultbuf;
     }
   else
     {
       int status;
       int buflen = 1024;
-      char *buffer = malloc (buflen);
+      char *buffer = calloc (1, buflen);
+      struct passwd resultbuf;
 
       if (debug_flag)
        dbg_log (_("Doesn't found \"%s\" in cache !"), param->key);
@@ -367,6 +367,9 @@ cache_pw_disabled (void *v_param)
 {
   param_t *param = (param_t *)v_param;
 
+  if (debug_flag)
+    dbg_log (_("\tpasswd cache is disabled\n"));
+
   pw_send_disabled (param->conn);
   return NULL;
 }
index 48328af032ac3684a7573adb38efed1cac1065b6..d0b78b2ecd3c76712a27b8ae8e9dec499cffbeed 100755 (executable)
@@ -23,8 +23,8 @@ echo 1_2 > $testdir/dir1/file1_2
 # Run some tests.
 result=0
 
-LD_LIBRARY_PATH=$common_objpfx \
-${elf_objpfx}${rtld_installed_name} ${common_objpfx}posix/globtest "$testdir" "*" |
+${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
+${common_objpfx}posix/globtest "$testdir" "*" |
 sort > $testout
 cat <<"EOF" | cmp - $testout || result=1
 `dir1'
@@ -34,8 +34,8 @@ cat <<"EOF" | cmp - $testout || result=1
 not NULL
 EOF
 
-LD_LIBRARY_PATH=$common_objpfx \
-${elf_objpfx}${rtld_installed_name} ${common_objpfx}posix/globtest "$testdir" "*/*" |
+${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
+${common_objpfx}posix/globtest "$testdir" "*/*" |
 sort > $testout
 cat <<"EOF" | cmp - $testout || result=1
 `dir1/file1_1'
@@ -43,40 +43,40 @@ cat <<"EOF" | cmp - $testout || result=1
 not NULL
 EOF
 
-LD_LIBRARY_PATH=$common_objpfx \
-${elf_objpfx}${rtld_installed_name} ${common_objpfx}posix/globtest "$testdir" "*/1" |
+${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
+${common_objpfx}posix/globtest "$testdir" "*/1" |
 sort > $testout
 cat <<"EOF" | cmp - $testout || result=1
 GLOB_NOMATCH
 NULL
 EOF
 
-LD_LIBRARY_PATH=$common_objpfx \
-${elf_objpfx}${rtld_installed_name} ${common_objpfx}posix/globtest "$testdir" "*/*1_1" |
+${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
+${common_objpfx}posix/globtest "$testdir" "*/*1_1" |
 sort > $testout
 cat <<"EOF" | cmp - $testout || result=1
 `dir1/file1_1'
 not NULL
 EOF
 
-LD_LIBRARY_PATH=$common_objpfx \
-${elf_objpfx}${rtld_installed_name} ${common_objpfx}posix/globtest "$testdir" "*/file1_1" |
+${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
+${common_objpfx}posix/globtest "$testdir" "*/file1_1" |
 sort > $testout
 cat <<"EOF" | cmp - $testout || result=1
 `dir1/file1_1'
 not NULL
 EOF
 
-LD_LIBRARY_PATH=$common_objpfx \
-${elf_objpfx}${rtld_installed_name} ${common_objpfx}posix/globtest "$testdir" "*-/*" |
+${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
+${common_objpfx}posix/globtest "$testdir" "*-/*" |
 sort > $testout
 cat <<"EOF" | cmp - $testout || result=1
 GLOB_NOMATCH
 NULL
 EOF
 
-LD_LIBRARY_PATH=$common_objpfx \
-${elf_objpfx}${rtld_installed_name} ${common_objpfx}posix/globtest "$testdir" "*-" |
+${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
+${common_objpfx}posix/globtest "$testdir" "*-" |
 sort > $testout
 cat <<"EOF" | cmp - $testout || result=1
 GLOB_NOMATCH
index 89bfc7f5a044bb74b8cb754c3f1e085500a21b38..959f0a178065ce8146fd4a5544ff624d4d7d85b3 100644 (file)
@@ -278,7 +278,7 @@ write_sample_server (definition * def)
          f_print(fout, "\txdr_free (xdr_result, result);\n");
          f_print(fout,
                  "\n\t/*\n\t * Insert additional freeing code here, if needed\n\t */\n");
-         f_print(fout, "\n\treturn 0;\n}\n");
+         f_print(fout, "\n\treturn 1;\n}\n");
        }
     }
 }
index 7e039deb8f7804926cd481d9c804062d8c035196..a8049e9de3928998e6cde964859958cd7de1cc64 100644 (file)
@@ -1,5 +1,5 @@
 /* longjmp for i386.
-   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1998 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
@@ -25,6 +25,8 @@
 ENTRY (__longjmp)
        movl 4(%esp), %ecx      /* User's jmp_buf in %ecx.  */
        movl 8(%esp), %eax      /* Second argument is return value.  */
+       /* Save the return address now.  */
+       movl (JB_PC*4)(%ecx), %edx
        /* Restore registers.  */
        movl (JB_BX*4)(%ecx), %ebx
        movl (JB_SI*4)(%ecx), %esi
@@ -32,6 +34,5 @@ ENTRY (__longjmp)
        movl (JB_BP*4)(%ecx), %ebp
        movl (JB_SP*4)(%ecx), %esp
        /* Jump to saved PC.  */
-       movl (JB_PC*4)(%ecx), %ecx
-       jmp *%ecx
+       jmp *%edx
 END (__longjmp)
index f8c42e0a1efc911bb4201ba4e1ab282ef9b4f4cd..4c35d969cf0a3a050f426e96a7cf1dd241e72187 100644 (file)
@@ -5,3 +5,11 @@ struct old_kernel_sigaction {
        unsigned long sa_mask;
        unsigned int sa_flags;
 };
+
+/* This is the sigaction structure from the Linux 2.1.68 kernel.  */
+
+struct kernel_sigaction {
+       __sighandler_t k_sa_handler;
+       unsigned int sa_flags;
+       sigset_t sa_mask;
+};
index 6e26a5e6e226db1690235c6a78be18f261585254..a6d2b63634b1ac2b034f3e4b236607f8c0c4b4a9 100644 (file)
@@ -28,8 +28,8 @@
 #include <kernel_sigaction.h>
 
 
-extern int __syscall_rt_sigaction (int, const struct sigaction *,
-                                  struct sigaction *, size_t);
+extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *,
+                                  struct kernel_sigaction *, size_t);
 
 /* The variable is shared between all wrappers around signal handling
    functions which have RT equivalents.  */
@@ -47,27 +47,34 @@ __sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
   /* First try the RT signals.  */
   if (!__libc_missing_rt_sigs)
     {
-      struct sigaction nact, *nactp;
+      struct kernel_sigaction kact, koact;
 
       if (act)
        {
-         nact.sa_handler = act->sa_handler;
-         memcpy (&nact.sa_mask, &act->sa_mask, sizeof (sigset_t));
-         nact.sa_flags = act->sa_flags;
+         kact.k_sa_handler = act->sa_handler;
+         memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
+         kact.sa_flags = act->sa_flags;
 
-         nact.sa_restorer = ((act->sa_flags & SA_NOMASK)
+         kact.sa_restorer = ((act->sa_flags & SA_NOMASK)
                              ? &&restore_nomask : &&restore);
-         nactp = &nact;
        }
-      else
-       nactp = NULL;
 
       /* XXX The size argument hopefully will have to be changed to the
         real size of the user-level sigset_t.  */
-      result = __syscall_rt_sigaction (sig, nactp, oact, _NSIG / 8);
+      result = __syscall_rt_sigaction (sig, act ? &kact : NULL,
+                                      oact ? &koact : NULL, _NSIG / 8);
 
       if (result >= 0 || errno != ENOSYS)
-       return result;
+       {
+         if (oact && result >= 0)
+           {
+             oact->sa_handler = koact.k_sa_handler;
+             memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
+             oact->sa_flags = koact.sa_flags;
+             oact->sa_restorer = koact.sa_restorer;
+           }
+         return result;
+       }
 
       __libc_missing_rt_sigs = 1;
     }
index e3901cfe5c72aba4128d3238232c7d00f72260f9..1ce2be20a1b18cc82bb3ab2bd7de703e25543b8a 100644 (file)
@@ -8,3 +8,12 @@ struct old_kernel_sigaction {
        unsigned long sa_flags;
        void (*sa_restorer) __P ((void));
 };
+
+/* This is the sigaction structure from the Linux 2.1.68 kernel.  */
+
+struct kernel_sigaction {
+       __sighandler_t k_sa_handler;
+       unsigned long sa_flags;
+       void (*sa_restorer) __P ((void));
+       sigset_t sa_mask;
+};
index 510cbe7040486fef158b48f098383bde97c7eedd..5f9a7feac3aa636855fa414e8c5724ae75cdedd4 100644 (file)
@@ -26,8 +26,8 @@
 
 extern int __syscall_sigaction (int, const struct old_kernel_sigaction *,
                                struct old_kernel_sigaction *);
-extern int __syscall_rt_sigaction (int, const struct sigaction *,
-                                  struct sigaction *, size_t);
+extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *,
+                                  struct kernel_sigaction *, size_t);
 
 /* The variable is shared between all wrappers around signal handling
    functions which have RT equivalents.  */
@@ -43,17 +43,41 @@ __sigaction (sig, act, oact)
      struct sigaction *oact;
 {
   struct old_kernel_sigaction k_sigact, k_osigact;
-  int error;
+  int result;
 
   /* First try the RT signals.  */
   if (!__libc_missing_rt_sigs)
     {
+      struct kernel_sigaction kact, koact;
+
+      if (act)
+       {
+         kact.k_sa_handler = act->sa_handler;
+         memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
+         kact.sa_flags = act->sa_flags;
+#ifdef HAVE_SA_RESTORER
+         kact.sa_restorer = act->sa_restorer;
+#endif
+       }
+
       /* XXX The size argument hopefully will have to be changed to the
         real size of the user-level sigset_t.  */
-      int result = __syscall_rt_sigaction (sig, act, oact, _NSIG / 8);
+      result = __syscall_rt_sigaction (sig, act ? &kact : 0,
+                                      oact ? &koact : 0, _NSIG / 8);
 
       if (result >= 0 || errno != ENOSYS)
-       return result;
+       {
+         if (oact && result >= 0)
+           {
+             oact->sa_handler = koact.k_sa_handler;
+             memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
+             oact->sa_flags = koact.sa_flags;
+#ifdef HAVE_SA_RESTORER
+             oact->sa_restorer = koact.sa_restorer;
+#endif
+           }
+         return result;
+       }
 
       __libc_missing_rt_sigs = 1;
     }
@@ -67,9 +91,9 @@ __sigaction (sig, act, oact)
       k_sigact.sa_restorer = act->sa_restorer;
 #endif
     }
-  error = __syscall_sigaction (sig, act ? &k_sigact : 0,
+  result = __syscall_sigaction (sig, act ? &k_sigact : 0,
                               oact ? &k_osigact : 0);
-  if (oact && error >= 0)
+  if (oact && result >= 0)
     {
       oact->sa_handler = k_osigact.k_sa_handler;
       oact->sa_mask.__val[0] = k_osigact.sa_mask;
@@ -78,7 +102,7 @@ __sigaction (sig, act, oact)
       oact->sa_restorer = k_osigact.sa_restorer;
 #endif
     }
-  return error;
+  return result;
 }
 
 weak_alias (__sigaction, sigaction)