Show
Ignore:
Timestamp:
05/01/08 13:14:43 (4 years ago)
Author:
rakshasa
Message:

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

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

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/rtorrent/src/rpc/exec_file.cc

    r1000 r1057  
    3939#include <string> 
    4040#include <unistd.h> 
     41#include <rak/error_number.h> 
    4142#include <rak/path.h> 
    4243#include <sys/types.h> 
     
    9192  } else { 
    9293    int status; 
     94    int wpid = waitpid(childPid, &status, 0); 
    9395 
    94     if (waitpid(childPid, &status, 0) != childPid) 
     96    while (wpid == -1 && rak::error_number::current().value() == rak::error_number::e_intr) 
     97      wpid = waitpid(childPid, &status, 0); 
     98 
     99    if (wpid != childPid) 
    95100      throw torrent::internal_error("ExecFile::execute(...) waitpid failed."); 
    96101