summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/Activator.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2018-07-27 13:55:58 +0200
committerJose <jose@zeroc.com>2018-07-27 13:55:58 +0200
commit83b85371785bae2928332ac758f2359b724ef420 (patch)
treede77474c09aeb5c2038286216578bbc628801734 /cpp/src/IceGrid/Activator.cpp
parentFix UWP Build failure (diff)
downloadice-83b85371785bae2928332ac758f2359b724ef420.tar.bz2
ice-83b85371785bae2928332ac758f2359b724ef420.tar.xz
ice-83b85371785bae2928332ac758f2359b724ef420.zip
Replace strerror usage with IceUtilInternal::errorToString
Close #154
Diffstat (limited to 'cpp/src/IceGrid/Activator.cpp')
-rw-r--r--cpp/src/IceGrid/Activator.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/cpp/src/IceGrid/Activator.cpp b/cpp/src/IceGrid/Activator.cpp
index 70ea3d9659f..bd76a224546 100644
--- a/cpp/src/IceGrid/Activator.cpp
+++ b/cpp/src/IceGrid/Activator.cpp
@@ -83,17 +83,14 @@ reportChildError(int err, int fd, const char* cannot, const char* name, const Tr
// Send any errors to the parent process, using the write
// end of the pipe.
//
- char msg[500];
- strcpy(msg, cannot);
- strcat(msg, " `");
- strcat(msg, name);
- strcat(msg, "'");
+ ostringstream os;
+ os << cannot << " `" << name << "'";
if(err)
{
- strcat(msg, ": ");
- strcat(msg, strerror(err));
+ os << ": " << IceUtilInternal::errorToString(err) << endl;
}
- ssize_t sz = write(fd, msg, strlen(msg));
+ const string msg = os.str();
+ ssize_t sz = write(fd, msg.c_str(), msg.size() + 1);
if(sz == -1)
{
Ice::Warning out(traceLevels->logger);