summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorvasiljevic <zv@archiware.com>2007-12-14 12:45:48 (GMT)
committervasiljevic <zv@archiware.com>2007-12-14 12:45:48 (GMT)
commitbf8e8201d27312ee1c6814a24c6ae7e02ecd85f1 (patch)
tree88d3c3f90a3cb3a9939eb83e9fdb7b4a23932824 /unix
parent1c95363481976a57b43d204d6f6d5e364bbb56b6 (diff)
downloadtcl-bf8e8201d27312ee1c6814a24c6ae7e02ecd85f1.zip
tcl-bf8e8201d27312ee1c6814a24c6ae7e02ecd85f1.tar.gz
tcl-bf8e8201d27312ee1c6814a24c6ae7e02ecd85f1.tar.bz2
TclpGetHostByName: 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')
-rw-r--r--unix/tclUnixCompat.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c
index 88c87c3..15b9588 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.1.2.11 2007/11/13 14:39:15 dkf Exp $
+ * RCS: @(#) $Id: tclUnixCompat.c,v 1.1.2.12 2007/12/14 12:45:48 vasiljevic Exp $
*
*/
@@ -585,10 +585,11 @@ TclpGetHostByName(const char *name)
#elif defined(HAVE_GETHOSTBYNAME_R_6)
struct hostent *hePtr;
- int h_errno;
- return (gethostbyname_r(name, &tsdPtr->hent, tsdPtr->hbuf,
- sizeof(tsdPtr->hbuf), &hePtr, &h_errno) == 0) ?
- &hePtr : NULL;
+ int result, h_errno;
+
+ 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;