From 53b1f467a9e16c6358a0e6d06db9413e1bc4c2c8 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 2 Aug 2009 12:15:04 +0000 Subject: Stop calling endpwent() and endgrent(); unneeded. [Bug 1942222] --- ChangeLog | 16 ++++++++++++---- unix/tclUnixFCmd.c | 8 ++------ unix/tclUnixFile.c | 6 ++---- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index ab6491c..04def18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,15 @@ +2009-08-02 Donal K. Fellows + + * unix/tclUnixFCmd.c (GetOwnerAttribute, SetOwnerAttribute) + (GetGroupAttribute, SetGroupAttribute): [Bug 1942222]: Stop calling + * unix/tclUnixFile.c (TclpGetUserHome): endpwent() and endgrent(); + they've been unnecessary for ages. + 2009-07-31 Don Porter - * generic/tclStringObj.c: Corrected failure to grow buffer - * tests/format.test: when format spec request large width - floating point values. Thanks to Clemens Misch. [Bug 2830354] + * generic/tclStringObj.c: [Bug 2830354]: Corrected failure to + * tests/format.test: grow buffer when format spec request + large width floating point values. Thanks to Clemens Misch. 2009-07-24 Andreas Kupries @@ -15,7 +22,8 @@ 2009-07-23 Joe Mistachkin - * generic/tclNotify.c: Fix for [Bug 2820349]. + * generic/tclNotify.c: [Bug 2820349]: Ensure that queued events are + freed once processed. 2009-07-21 Kevin B. Kenny diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index 41b1003..e517e6f 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixFCmd.c,v 1.65 2007/12/13 15:28:42 dgp Exp $ + * RCS: @(#) $Id: tclUnixFCmd.c,v 1.65.2.1 2009/08/02 12:15:04 dkf Exp $ * * Portions of this code were derived from NetBSD source code which has the * following copyright notice: @@ -1338,7 +1338,6 @@ GetGroupAttribute( *attributePtrPtr = Tcl_NewStringObj(utf, -1); Tcl_DStringFree(&ds); } - endgrent(); return TCL_OK; } @@ -1393,7 +1392,6 @@ GetOwnerAttribute( *attributePtrPtr = Tcl_NewStringObj(utf, Tcl_DStringLength(&ds)); Tcl_DStringFree(&ds); } - endpwent(); return TCL_OK; } @@ -1480,7 +1478,6 @@ SetGroupAttribute( Tcl_DStringFree(&ds); if (groupPtr == NULL) { - endgrent(); if (interp != NULL) { Tcl_AppendResult(interp, "could not set group for file \"", TclGetString(fileName), "\": group \"", string, @@ -1494,7 +1491,6 @@ SetGroupAttribute( native = Tcl_FSGetNativePath(fileName); result = chown(native, (uid_t) -1, (gid_t) gid); /* INTL: Native. */ - endgrent(); if (result != 0) { if (interp != NULL) { Tcl_AppendResult(interp, "could not set group for file \"", @@ -1542,7 +1538,7 @@ SetOwnerAttribute( string = Tcl_GetStringFromObj(attributePtr, &length); native = Tcl_UtfToExternalDString(NULL, string, length, &ds); - pwPtr = TclpGetPwNam(native); /* INTL: Native. */ + pwPtr = TclpGetPwNam(native); /* INTL: Native. */ Tcl_DStringFree(&ds); if (pwPtr == NULL) { diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index d11b43c..c3ad48b 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixFile.c,v 1.52 2007/12/13 15:28:42 dgp Exp $ + * RCS: @(#) $Id: tclUnixFile.c,v 1.52.2.1 2009/08/02 12:15:04 dkf Exp $ */ #include "tclInt.h" @@ -567,15 +567,13 @@ TclpGetUserHome( CONST char *native; native = Tcl_UtfToExternalDString(NULL, name, -1, &ds); - pwPtr = getpwnam(native); /* INTL: Native. */ + pwPtr = TclpGetPwNam(native); /* INTL: Native. */ Tcl_DStringFree(&ds); if (pwPtr == NULL) { - endpwent(); return NULL; } Tcl_ExternalToUtfDString(NULL, pwPtr->pw_dir, -1, bufferPtr); - endpwent(); return Tcl_DStringValue(bufferPtr); } -- cgit v0.12