Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/lib/libc/net Pull up revision 1.29 (requested by thorpej ...



details:   https://anonhg.NetBSD.org/src/rev/f843166800a4
branches:  netbsd-3
changeset: 576433:f843166800a4
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Jul 02 23:21:24 2005 +0000

description:
Pull up revision 1.29 (requested by thorpej in ticket #501):
_nsdispatching needs to count, not just be 1 or 0.  Also shuffle
around
its use a little to eliminate some duplication.

diffstat:

 lib/libc/net/nsdispatch.c |  22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)

diffs (52 lines):

diff -r f42f06a1ab81 -r f843166800a4 lib/libc/net/nsdispatch.c
--- a/lib/libc/net/nsdispatch.c Sat Jul 02 23:19:27 2005 +0000
+++ b/lib/libc/net/nsdispatch.c Sat Jul 02 23:21:24 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nsdispatch.c,v 1.28 2004/11/10 07:23:32 lukem Exp $    */
+/*     $NetBSD: nsdispatch.c,v 1.28.2.1 2005/07/02 23:21:24 tron Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: nsdispatch.c,v 1.28 2004/11/10 07:23:32 lukem Exp $");
+__RCSID("$NetBSD: nsdispatch.c,v 1.28.2.1 2005/07/02 23:21:24 tron Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -652,16 +652,12 @@
                        mutex_unlock(&_ns_drec_lock);
                        return (NS_UNAVAIL);
                }
-       } else {
-               if (_nsdispatching == 0 && _nsconfigure())
-                       return (NS_UNAVAIL);
-               _nsdispatching = 1;
+       } else
+#endif /* _REENTRANT */
+       if (_nsdispatching++ == 0 && _nsconfigure()) {
+               _nsdispatching--;
+               return (NS_UNAVAIL);
        }
-#else
-       if (_nsdispatching == 0 && _nsconfigure())
-               return (NS_UNAVAIL);
-       _nsdispatching = 1;
-#endif /* _REENTRANT */
 
        rwlock_rdlock(&_nslock);
 
@@ -702,10 +698,8 @@
                LIST_REMOVE(&drec, list);
                mutex_unlock(&_ns_drec_lock);
        } else
-               _nsdispatching = 0;
-#else
-       _nsdispatching = 0;
 #endif /* _REENTRANT */
+               _nsdispatching--;
 
        return (result ? result : NS_NOTFOUND);
 }



Home | Main Index | Thread Index | Old Index