mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-08 11:12:31 +00:00
* 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:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user