summaryrefslogtreecommitdiff
path: root/cpp/src/IcePack/Activator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IcePack/Activator.cpp')
-rw-r--r--cpp/src/IcePack/Activator.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/cpp/src/IcePack/Activator.cpp b/cpp/src/IcePack/Activator.cpp
index 4ab6f4b9294..19ce84ca1f2 100644
--- a/cpp/src/IcePack/Activator.cpp
+++ b/cpp/src/IcePack/Activator.cpp
@@ -25,7 +25,9 @@ IcePack::Activator::Activator(const CommunicatorPtr& communicator) :
int fds[2];
if (pipe(fds) != 0)
{
- throw SystemException(__FILE__, __LINE__);
+ SystemException ex(__FILE__, __LINE__);
+ ex.error = getSystemErrno();
+ throw ex;
}
_fdIntrRead = fds[0];
_fdIntrWrite = fds[1];
@@ -127,12 +129,16 @@ IcePack::Activator::activate(const ServerDescription& desc)
int fds[2];
if (pipe(fds) != 0)
{
- throw SystemException(__FILE__, __LINE__);
+ SystemException ex(__FILE__, __LINE__);
+ ex.error = getSystemErrno();
+ throw ex;
}
pid_t pid = fork();
if (pid == -1)
{
- throw SystemException(__FILE__, __LINE__);
+ SystemException ex(__FILE__, __LINE__);
+ ex.error = getSystemErrno();
+ throw ex;
}
if (pid == 0) // Child process
{
@@ -168,6 +174,8 @@ IcePack::Activator::activate(const ServerDescription& desc)
// end of the pipe.
//
SystemException ex(__FILE__, __LINE__);
+ ex.error = getSystemErrno();
+ throw ex;
ostringstream s;
s << "can't execute `" << path << "':\n" << ex;
write(fds[1], s.str().c_str(), s.str().length());
@@ -234,7 +242,9 @@ IcePack::Activator::terminationListener()
goto repeatSelect;
}
- throw SystemException(__FILE__, __LINE__);
+ SystemException ex(__FILE__, __LINE__);
+ ex.error = getSystemErrno();
+ throw ex;
}
{
@@ -260,7 +270,9 @@ IcePack::Activator::terminationListener()
int ret = read(fd, &s, 16);
if (ret == -1)
{
- throw SystemException(__FILE__, __LINE__);
+ SystemException ex(__FILE__, __LINE__);
+ ex.error = getSystemErrno();
+ throw ex;
}
else if(ret == 0)
{
@@ -304,7 +316,9 @@ IcePack::Activator::terminationListener()
{
if (errno != ECHILD) // Ignore ECHILD
{
- throw SystemException(__FILE__, __LINE__);
+ SystemException ex(__FILE__, __LINE__);
+ ex.error = getSystemErrno();
+ throw ex;
}
}
}