diff options
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); |