about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-07-25 22:19:16 +0000
committerUlrich Drepper <drepper@redhat.com>2000-07-25 22:19:16 +0000
commit3452aba811b77932788ac10de324653140bca936 (patch)
tree3204a06d66c29be1eb351211de1b7b8d77a31686
parent16093625a6a30a7977c8e8ed7bb7ce95ef17c8d1 (diff)
downloadglibc-3452aba811b77932788ac10de324653140bca936.tar.gz
glibc-3452aba811b77932788ac10de324653140bca936.tar.xz
glibc-3452aba811b77932788ac10de324653140bca936.zip
Update.
2000-07-25  Mark Kettenis  <kettenis@gnu.org>

	* nss/nss_files/files-netgrp.c (strip_whitespace): New function.
	(_nss_netgroup_parseline): Use strip_whitespace to strip off any
	leading and trailing spaces from host, user and domain name.

2000-07-25  Jes Sorensen  <jes@linuxcare.com>

	* csu/defs.awk: Add support for need_endp.

2000-07-25  Mark Kettenis  <kettenis@gnu.org>

	* resolv/resolv.h: Remove __P from res_send_qhook and
	res_send_rhook typedefs.

2000-07-25  Bruno Haible  <haible@clisp.cons.org>

	* intl/tst-translit.c (main): Unset OUTPUT_CHARSET.
-rw-r--r--ChangeLog19
-rw-r--r--csu/defs.awk9
-rw-r--r--intl/tst-translit.c1
-rw-r--r--linuxthreads/internals.h5
-rw-r--r--linuxthreads/pthread.c6
-rw-r--r--nss/nss_files/files-netgrp.c33
-rw-r--r--resolv/resolv.h24
7 files changed, 71 insertions, 26 deletions
diff --git a/ChangeLog b/ChangeLog
index 031d30dd6d..0fbdf5ef90 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2000-07-25  Mark Kettenis  <kettenis@gnu.org>
+
+	* nss/nss_files/files-netgrp.c (strip_whitespace): New function.
+	(_nss_netgroup_parseline): Use strip_whitespace to strip off any
+	leading and trailing spaces from host, user and domain name.
+
+2000-07-25  Jes Sorensen  <jes@linuxcare.com>
+
+	* csu/defs.awk: Add support for need_endp.
+
+2000-07-25  Mark Kettenis  <kettenis@gnu.org>
+
+	* resolv/resolv.h: Remove __P from res_send_qhook and
+	res_send_rhook typedefs.
+
+2000-07-25  Bruno Haible  <haible@clisp.cons.org>
+
+	* intl/tst-translit.c (main): Unset OUTPUT_CHARSET.
+
 2000-07-25  Ulrich Drepper  <drepper@redhat.com>
 
 	* iconv/gconv_builtin.h: Add WCHAR_T alias.
diff --git a/csu/defs.awk b/csu/defs.awk
index a006c983e2..7ca5a33646 100644
--- a/csu/defs.awk
+++ b/csu/defs.awk
@@ -1,8 +1,13 @@
-/^[ 	]*\.end/   { need_end = 1 }
+/^[ 	]*\.endp/	 { need_endp = 1 }
+/^[ 	]*\.end/	 { need_end = 1 }
 /^[ 	]*\.align/ { if($2 > max) max = $2; }
 
 END {
-    if(need_end)
+    if(need_endp)
+    {
+	print "#define END_INIT .endp _init";
+	print "#define END_FINI .endp _fini";
+    } else if(need_end)
     {
 	print "#define END_INIT .end _init";
 	print "#define END_FINI .end _fini";
diff --git a/intl/tst-translit.c b/intl/tst-translit.c
index 4bd8749dac..79085dfeb0 100644
--- a/intl/tst-translit.c
+++ b/intl/tst-translit.c
@@ -29,6 +29,7 @@ main (void)
   const char *s;
 
   setenv ("LANGUAGE", "existing-locale", 1);
+  unsetenv ("OUTPUT_CHARSET");
   textdomain ("translit");
   bindtextdomain ("translit", OBJPFX "domaindir");
 
diff --git a/linuxthreads/internals.h b/linuxthreads/internals.h
index 7335611669..2ed49295ee 100644
--- a/linuxthreads/internals.h
+++ b/linuxthreads/internals.h
@@ -20,16 +20,13 @@
 /* Includes */
 
 #include <limits.h>
+#include <resolv.h>
 #include <setjmp.h>
 #include <signal.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include <bits/libc-tsd.h> /* for _LIBC_TSD_KEY_N */
 
-#define __RES_PTHREAD_INTERNAL
-#include <resolv.h> /* for per-thread resolver context */
-
-
 #include "pt-machine.h"
 #include "semaphore.h"
 #include "../linuxthreads_db/thread_dbP.h"
diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c
index 1d93366380..3a669c8dec 100644
--- a/linuxthreads/pthread.c
+++ b/linuxthreads/pthread.c
@@ -30,6 +30,12 @@
 #include "spinlock.h"
 #include "restart.h"
 
+/* We need the global/static resolver state here.  */
+#include <resolv.h>
+#undef _res
+
+extern struct __res_state _res;
+
 /* Sanity check.  */
 #if __ASSUME_REALTIME_SIGNALS && !defined __SIGRTMIN
 # error "This must not happen; new kernel assumed but old headers"
diff --git a/nss/nss_files/files-netgrp.c b/nss/nss_files/files-netgrp.c
index eb6e673ad0..4ffafb2233 100644
--- a/nss/nss_files/files-netgrp.c
+++ b/nss/nss_files/files-netgrp.c
@@ -1,5 +1,5 @@
 /* Netgroup file parser in nss_files modules.
-   Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -159,6 +159,24 @@ _nss_files_endnetgrent (struct __netgrent *result)
   return NSS_STATUS_SUCCESS;
 }
 
+static char *
+strip_whitespace (char *str)
+{
+  char *cp = str;
+
+  /* Skip leading spaces.  */
+  while (isspace (*cp))
+    cp++;
+
+  str = cp;
+  while (*cp != '\0' && ! isspace(*cp))
+    cp++;
+
+  /* Null-terminate, stripping off any trailing spaces.  */
+  *cp = '\0';
+
+  return *str == '\0' ? NULL : str;
+}
 
 enum nss_status
 _nss_netgroup_parseline (char **cursor, struct __netgrent *result,
@@ -235,15 +253,14 @@ _nss_netgroup_parseline (char **cursor, struct __netgrent *result,
       memcpy (buffer, host, cp - host);
       result->type = triple_val;
 
-      buffer[(user - host) - 1] = '\0';
-      result->val.triple.host = *host == ',' ? NULL : buffer;
+      buffer[(user - host) - 1] = '\0';	/* Replace ',' with '\0'.  */
+      result->val.triple.host = strip_whitespace (buffer);
 
-      buffer[(domain - host) - 1] = '\0';
-      result->val.triple.user = *user == ',' ? NULL : buffer + (user - host);
+      buffer[(domain - host) - 1] = '\0'; /* Replace ',' with '\0'.  */
+      result->val.triple.user = strip_whitespace (buffer + (user - host));
 
-      buffer[(cp - host) - 1] = '\0';
-      result->val.triple.domain =
-	*domain == ')' ? NULL : buffer + (domain - host);
+      buffer[(cp - host) - 1] = '\0'; /* Replace ')' with '\0'.  */
+      result->val.triple.domain = strip_whitespace (buffer + (domain - host));
 
       status = NSS_STATUS_SUCCESS;
 
diff --git a/resolv/resolv.h b/resolv/resolv.h
index d9f798b3b2..c7374b8bfc 100644
--- a/resolv/resolv.h
+++ b/resolv/resolv.h
@@ -87,19 +87,19 @@
 typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
 	res_sendhookact;
 
-typedef res_sendhookact (*res_send_qhook)__P((struct sockaddr_in * const *ns,
-					      const u_char **query,
-					      int *querylen,
-					      u_char *ans,
-					      int anssiz,
-					      int *resplen));
+typedef res_sendhookact (*res_send_qhook) (struct sockaddr_in * const *ns,
+					   const u_char **query,
+					   int *querylen,
+					   u_char *ans,
+					   int anssiz,
+					   int *resplen);
 
-typedef res_sendhookact (*res_send_rhook)__P((const struct sockaddr_in *ns,
-					      const u_char *query,
-					      int querylen,
-					      u_char *ans,
-					      int anssiz,
-					      int *resplen));
+typedef res_sendhookact (*res_send_rhook) (const struct sockaddr_in *ns,
+					   const u_char *query,
+					   int querylen,
+					   u_char *ans,
+					   int anssiz,
+					   int *resplen);
 
 struct res_sym {
 	int	number;		/* Identifying number, like T_MX */