From owner-p4-projects@FreeBSD.ORG Tue Jul 12 18:36:41 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3B04516A462; Tue, 12 Jul 2005 18:36:41 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EE93116A444 for ; Tue, 12 Jul 2005 18:36:40 +0000 (GMT) (envelope-from soc-bushman@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9D49743D49 for ; Tue, 12 Jul 2005 18:36:40 +0000 (GMT) (envelope-from soc-bushman@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j6CIaeVt081330 for ; Tue, 12 Jul 2005 18:36:40 GMT (envelope-from soc-bushman@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j6CIae5R081325 for perforce@freebsd.org; Tue, 12 Jul 2005 18:36:40 GMT (envelope-from soc-bushman@freebsd.org) Date: Tue, 12 Jul 2005 18:36:40 GMT Message-Id: <200507121836.j6CIae5R081325@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to soc-bushman@freebsd.org using -f From: soc-bushman To: Perforce Change Reviews Cc: Subject: PERFORCE change 80049 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2005 18:36:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=80049 Change 80049 by soc-bushman@soc-bushman_stinger on 2005/07/12 18:35:59 bugfix in files_servent + testing system Affected files ... .. //depot/projects/soc2005/nsswitch_cached/src/lib/libc/net/getservent.c#10 edit .. //depot/projects/soc2005/nsswitch_cached/tests/common/Makefile#1 add .. //depot/projects/soc2005/nsswitch_cached/tests/common/debug.c#1 add .. //depot/projects/soc2005/nsswitch_cached/tests/common/debug.h#1 add .. //depot/projects/soc2005/nsswitch_cached/tests/common/test.c#1 add .. //depot/projects/soc2005/nsswitch_cached/tests/common/test.h#1 add .. //depot/projects/soc2005/nsswitch_cached/tests/common_test/Makefile#1 add .. //depot/projects/soc2005/nsswitch_cached/tests/common_test/common_test.c#1 add .. //depot/projects/soc2005/nsswitch_cached/tests/getservent/getservent.c#5 delete .. //depot/projects/soc2005/nsswitch_cached/tests/getservent/libc_private.h#2 delete .. //depot/projects/soc2005/nsswitch_cached/tests/getservent/namespace.h#2 delete .. //depot/projects/soc2005/nsswitch_cached/tests/getservent/netdb_private.h#2 delete .. //depot/projects/soc2005/nsswitch_cached/tests/getservent/nss_tls.h#2 delete .. //depot/projects/soc2005/nsswitch_cached/tests/getservent/reentrant.h#2 delete .. //depot/projects/soc2005/nsswitch_cached/tests/getservent/un-namespace.h#2 delete .. //depot/projects/soc2005/nsswitch_cached/tests/getservent_test/Makefile#1 add .. //depot/projects/soc2005/nsswitch_cached/tests/getservent_test/getservent.c#1 add .. //depot/projects/soc2005/nsswitch_cached/tests/getservent_test/getservent.h#1 add .. //depot/projects/soc2005/nsswitch_cached/tests/getservent_test/getservent_test.c#1 add Differences ... ==== //depot/projects/soc2005/nsswitch_cached/src/lib/libc/net/getservent.c#10 (text+ko) ==== @@ -352,7 +352,7 @@ continue; } - rv = servent_unpack(line, serv, aliases, aliases_size, errnop); + rv = servent_unpack(buffer, serv, aliases, aliases_size, errnop); if (rv !=0 ) { if (*errnop == 0) { rv = NS_NOTFOUND; @@ -391,12 +391,12 @@ } while (!(rv & NS_TERMINATE)); - if (!stayopen && st->fp!=NULL) { + if (!stayopen && st->fp != NULL) { fclose(st->fp); st->fp = NULL; } - if ((rv ==NS_SUCCESS) && (retval != NULL)) + if ((rv == NS_SUCCESS) && (retval != NULL)) *(struct servent **)retval=serv; return (rv); @@ -423,7 +423,11 @@ st->stayopen |= f; break; case ENDSERVENT: - st->stayopen = 0; + if (st->fp != NULL) { + fclose(st->fp); + st->fp = NULL; + } + st->stayopen = 0; break; default: break;