aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-05-22 22:42:54 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-05-22 22:42:54 +0000
commitb19bca4123308158bf6ae59887c9b1ec41179701 (patch)
tree9ae64db4bcc0858028d20b992ce5b555b11e1ba6
parentdba69d827e2c0df73829c8ff95ff424230f8b856 (diff)
downloadpaludis-b19bca4123308158bf6ae59887c9b1ec41179701.tar.gz
paludis-b19bca4123308158bf6ae59887c9b1ec41179701.tar.xz
Improve error condition handling
-rw-r--r--paludis/util/system.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/paludis/util/system.cc b/paludis/util/system.cc
index 14e7c5b..7163cac 100644
--- a/paludis/util/system.cc
+++ b/paludis/util/system.cc
@@ -24,6 +24,7 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
+#include <errno.h>
#include "config.h"
/** \file
@@ -86,15 +87,16 @@ paludis::run_command(const std::string & cmd)
{
Log::get_instance()->message(ll_debug, "execl /bin/sh -c " + cmd);
execl("/bin/sh", "sh", "-c", cmd.c_str(), static_cast<char *>(0));
- throw InternalError(PALUDIS_HERE, "execl failed"); /// \todo fixme
+ throw InternalError(PALUDIS_HERE, "execl /bin/sh -c '" + cmd + "' failed:"
+ + stringify(strerror(errno)));
}
else if (-1 == child)
- throw InternalError(PALUDIS_HERE, "fork failed"); /// \todo fixme
+ throw InternalError(PALUDIS_HERE, "fork failed: " + stringify(strerror(errno)));
else
{
int status(-1);
if (-1 == wait(&status))
- throw InternalError(PALUDIS_HERE, "wait failed"); /// \todo fixme
+ throw InternalError(PALUDIS_HERE, "wait failed: " + stringify(strerror(errno)));
return status;
}