aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-04 17:12:42 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-04 17:12:42 +0000
commitf0cafc25ec73be105a04069f11375c39b24d897e (patch)
tree137b6b9a7c89dc23e060299add544e68e0b967aa
parent8d66696d83ee6fb0200defd510ba381280c0fb82 (diff)
downloadpaludis-f0cafc25ec73be105a04069f11375c39b24d897e.tar.gz
paludis-f0cafc25ec73be105a04069f11375c39b24d897e.tar.xz
Include the exit status in the log
-rw-r--r--paludis/pstream.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/paludis/pstream.cc b/paludis/pstream.cc
index f5584de..41a6e09 100644
--- a/paludis/pstream.cc
+++ b/paludis/pstream.cc
@@ -58,11 +58,12 @@ PStreamInBuf::PStreamInBuf(const std::string & command) :
_command(command),
fd(popen(command.c_str(), "r"))
{
- Log::get_instance()->message(ll_debug, "popen " + command);
+ Log::get_instance()->message(ll_debug, "popen " + command + " -> " + stringify(
+ fileno(fd)));
if (0 == fd)
throw PStreamError("popen('" + _command + "', 'r') failed: " +
- strerror(errno));
+ std::strerror(errno));
setg(buffer + putback_size, buffer + putback_size, buffer + putback_size);
}
@@ -70,7 +71,10 @@ PStreamInBuf::PStreamInBuf(const std::string & command) :
PStreamInBuf::~PStreamInBuf()
{
if (0 != fd)
- pclose(fd);
+ {
+ int fdn = fileno(fd), x = pclose(fd);
+ Log::get_instance()->message(ll_debug, "pclose " + stringify(fdn) + " -> " + stringify(x));
+ }
}
int
@@ -78,8 +82,11 @@ PStreamInBuf::exit_status()
{
if (0 != fd)
{
+ int fdn = fileno(fd);
_exit_status = pclose(fd);
fd = 0;
+ Log::get_instance()->message(ll_debug, "manual pclose " + stringify(fdn) + " -> " + stringify(
+ _exit_status));
}
return _exit_status;
}