diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-03-10 05:15:26 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-03-10 05:15:26 +0000 |
commit | 1d88b533f61a8e86a0609fd906a86fecfadc6d1a (patch) | |
tree | d1dc0050555555f4da3069683acbfdbd038a615c /ext/Socket | |
parent | 095a0503139d0a302aafb5098d9481c2b47c10fc (diff) | |
download | perl-1d88b533f61a8e86a0609fd906a86fecfadc6d1a.tar.gz |
Misc tiny tweaks from Sarathy, good for threaded builds.
p4raw-id: //depot/perl@15141
Diffstat (limited to 'ext/Socket')
-rw-r--r-- | ext/Socket/Socket.xs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs index 79e1dfd22a..d844775e4f 100644 --- a/ext/Socket/Socket.xs +++ b/ext/Socket/Socket.xs @@ -263,8 +263,9 @@ inet_ntoa(ip_address_sv) addrlen, sizeof(addr)); /* We could use inet_ntoa() but that is broken * in HP-UX + GCC + 64bitint (returns "0.0.0.0"), - * so let's use this sprintf() workaround everywhere. */ - New(1138, addr_str, 4 * 3 + 3 + 1, char); + * so let's use this sprintf() workaround everywhere. + * This is also more threadsafe than using inet_ntoa(). */ + New(1138, addr_str, 4 * 3 + 3 + 1, char); /* IPv6? */ sprintf(addr_str, "%d.%d.%d.%d", ((addr.s_addr >> 24) & 0xFF), ((addr.s_addr >> 16) & 0xFF), |