* Fixed EINTR handling in execute command. Patch by anonymous.

* Fixed a couple of memory leaks in xmlrpc.cc. Reported by Novik.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1057 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2008-05-01 17:14:43 +00:00
parent fcbad61577
commit 3f64e8b1fa
3 changed files with 17 additions and 6 deletions
+6 -1
View File
@@ -38,6 +38,7 @@
#include <string>
#include <unistd.h>
#include <rak/error_number.h>
#include <rak/path.h>
#include <sys/types.h>
#include <sys/wait.h>
@@ -90,8 +91,12 @@ ExecFile::execute(const char* file, char* const* argv) {
} else {
int status;
int wpid = waitpid(childPid, &status, 0);
if (waitpid(childPid, &status, 0) != childPid)
while (wpid == -1 && rak::error_number::current().value() == rak::error_number::e_intr)
wpid = waitpid(childPid, &status, 0);
if (wpid != childPid)
throw torrent::internal_error("ExecFile::execute(...) waitpid failed.");
// Check return value?