mirror of
https://github.com/transmission/transmission
synced 2024-12-26 17:47:37 +00:00
(libT) #4633 'if executing the torrent-done script fails, log an error' -- done.
This commit is contained in:
parent
707a131b4f
commit
cd0628fc8f
1 changed files with 6 additions and 2 deletions
|
@ -1988,7 +1988,8 @@ torrentCallScript (const tr_torrent * tor, const char * script)
|
|||
tr_torinf (tor, "Calling script \"%s\"", script);
|
||||
|
||||
#ifdef WIN32
|
||||
_spawnvpe (_P_NOWAIT, script, (const char*)cmd, env);
|
||||
if (spawnvpe (_P_NOWAIT, script, (const char*)cmd, env) == -1)
|
||||
tr_torerr (tor, "error executing script \"%s\": %s", cmd[0], tr_strerror (errno));
|
||||
#else
|
||||
signal (SIGCHLD, onSigCHLD);
|
||||
|
||||
|
@ -1996,7 +1997,10 @@ torrentCallScript (const tr_torrent * tor, const char * script)
|
|||
{
|
||||
for (i=0; env[i]; ++i)
|
||||
putenv (env[i]);
|
||||
execvp (script, cmd);
|
||||
|
||||
if (execvp (script, cmd) == -1)
|
||||
tr_torerr (tor, "error executing script \"%s\": %s", cmd[0], tr_strerror (errno));
|
||||
|
||||
_exit (0);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue