diff options
| author | donal.k.fellows@manchester.ac.uk <dkf> | 2007-11-13 14:36:04 (GMT) |
|---|---|---|
| committer | donal.k.fellows@manchester.ac.uk <dkf> | 2007-11-13 14:36:04 (GMT) |
| commit | ecd5018a5a7703b2b0b2a354b9a2f5be0189b92d (patch) | |
| tree | 5142878a2e2eab5fe9b4658d6c57a12c61b1382b /unix/tclUnixCompat.c | |
| parent | 057b75c3ce19beca1f662ae73ba526467d6e3eda (diff) | |
| download | tcl-ecd5018a5a7703b2b0b2a354b9a2f5be0189b92d.zip tcl-ecd5018a5a7703b2b0b2a354b9a2f5be0189b92d.tar.gz tcl-ecd5018a5a7703b2b0b2a354b9a2f5be0189b92d.tar.bz2 | |
The six-argument form of getaddressbyname_r() uses the fifth argument to
indicate whether the lookup succeeded or not on at least one platform. [Bug
1618235]
Diffstat (limited to 'unix/tclUnixCompat.c')
| -rw-r--r-- | unix/tclUnixCompat.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c index da3cd9d..2b5f53c 100644 --- a/unix/tclUnixCompat.c +++ b/unix/tclUnixCompat.c @@ -6,7 +6,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixCompat.c,v 1.11 2007/09/07 00:34:07 dgp Exp $ + * RCS: @(#) $Id: tclUnixCompat.c,v 1.12 2007/11/13 14:36:04 dkf Exp $ * */ @@ -345,12 +345,12 @@ TclpGetHostByName( sizeof(tsdPtr->hbuf), &h_errno); #elif defined(HAVE_GETHOSTBYNAME_R_6) - struct hostent *hePtr; - int h_errno; + struct hostent *hePtr = NULL; + int h_errno, result; - return (gethostbyname_r(name, &tsdPtr->hent, tsdPtr->hbuf, - sizeof(tsdPtr->hbuf), &hePtr, &h_errno) == 0) - ? &tsdPtr->hent : NULL; + result = gethostbyname_r(name, &tsdPtr->hent, tsdPtr->hbuf, + sizeof(tsdPtr->hbuf), &hePtr, &h_errno); + return (result == 0) ? hePtr : NULL; #elif defined(HAVE_GETHOSTBYNAME_R_3) struct hostent_data data; |
