diff options
author | 2006-02-04 17:12:42 +0000 | |
---|---|---|
committer | 2006-02-04 17:12:42 +0000 | |
commit | f0cafc25ec73be105a04069f11375c39b24d897e (patch) | |
tree | 137b6b9a7c89dc23e060299add544e68e0b967aa | |
parent | 8d66696d83ee6fb0200defd510ba381280c0fb82 (diff) | |
download | paludis-f0cafc25ec73be105a04069f11375c39b24d897e.tar.gz paludis-f0cafc25ec73be105a04069f11375c39b24d897e.tar.xz |
Include the exit status in the log
-rw-r--r-- | paludis/pstream.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/paludis/pstream.cc b/paludis/pstream.cc index f5584de65..41a6e09af 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; } |