diff options
author | Jose <jose@zeroc.com> | 2018-07-27 13:55:58 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2018-07-27 13:55:58 +0200 |
commit | 83b85371785bae2928332ac758f2359b724ef420 (patch) | |
tree | de77474c09aeb5c2038286216578bbc628801734 /cpp/src/IceGrid/Activator.cpp | |
parent | Fix UWP Build failure (diff) | |
download | ice-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.cpp | 13 |
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); |