mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-16 23:22:31 +00:00
* Added 'execute.*.bg' commands for non-blocking calls. Always returns 0.
* Added support for prioritizing first/last chunk of files matching specified patterns. Default:
file.prioritize_toc.set=0
file.prioritize_toc.first.set = {*.avi,*.mp4,*.mkv,*.gz}
file.prioritize_toc.last.set = {*.zip}
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1230 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+11
-3
@@ -131,11 +131,19 @@ ExecFile::execute(const char* file, char* const* argv, int flags) {
|
||||
}
|
||||
}
|
||||
|
||||
int status;
|
||||
int wpid = waitpid(childPid, &status, 0);
|
||||
if (flags & flag_background) {
|
||||
if (m_logFd != -1)
|
||||
write(m_logFd, "\n--- Background task ---\n", sizeof("\n--- Background task ---\n"));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (wpid == -1 && rak::error_number::current().value() == rak::error_number::e_intr)
|
||||
int status;
|
||||
int wpid;
|
||||
|
||||
do {
|
||||
wpid = waitpid(childPid, &status, 0);
|
||||
} while (wpid == -1 && rak::error_number::current().value() == rak::error_number::e_intr);
|
||||
|
||||
if (wpid != childPid)
|
||||
throw torrent::internal_error("ExecFile::execute(...) waitpid failed.");
|
||||
|
||||
Reference in New Issue
Block a user