From 5dc1635495a56150cc858816a0c3512fbc3386b3 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Thu, 15 Apr 2010 13:39:03 +0000 Subject: [PATCH] removed using ntop instead of ntoa to get rid of mutex (ref r30374:30377) git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1789 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/AmUtils.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/AmUtils.cpp b/core/AmUtils.cpp index 044b2bbc..3bbd69e9 100644 --- a/core/AmUtils.cpp +++ b/core/AmUtils.cpp @@ -419,13 +419,12 @@ string filename_from_fullpath(const string& path) return ""; } -AmMutex inet_ntoa_mut; string get_addr_str(struct in_addr in) { - inet_ntoa_mut.lock(); - string addr = inet_ntoa(in); - inet_ntoa_mut.unlock(); - return addr; + char res[46]; // INET6_ADDRSTRLEN + if (inet_ntop(AF_INET, &in, res, 46)) + return string(res); + else return ""; } AmMutex inet_gethostbyname;