From: Charles Kerr Date: Wed, 15 Dec 2010 14:55:20 +0000 (+0000) Subject: (trunk libT) #3764 "script-torrent-done shouldn't block libtransmission" -- add the... X-Git-Tag: 2.20b1~189 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a5a429761a8300117031082299bf75d1ca32f8d;p=transmission (trunk libT) #3764 "script-torrent-done shouldn't block libtransmission" -- add the "calling script ..." line back into the logfile. --- diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 8eba2276e..fe94c4036 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -1863,17 +1863,20 @@ torrentCallScript( const tr_torrent * tor, const char * script ) if( script && *script ) { char * cmd[] = { tr_strdup( script ), NULL }; - char * env[] = { tr_strdup_printf( "TR_APP_VERSION=%s", SHORT_VERSION_STRING ), - tr_strdup_printf( "TR_TIME_LOCALTIME=%s", timeStr ), - tr_strdup_printf( "TR_TORRENT_DIR=%s", tor->currentDir ), - tr_strdup_printf( "TR_TORRENT_ID=%d", tr_torrentId( tor ) ), - tr_strdup_printf( "TR_TORRENT_HASH=%s", tor->info.hashString ), - tr_strdup_printf( "TR_TORRENT_NAME=%s", tr_torrentName( tor ) ), - NULL }; + char * env[] = { + tr_strdup_printf( "TR_APP_VERSION=%s", SHORT_VERSION_STRING ), + tr_strdup_printf( "TR_TIME_LOCALTIME=%s", timeStr ), + tr_strdup_printf( "TR_TORRENT_DIR=%s", tor->currentDir ), + tr_strdup_printf( "TR_TORRENT_ID=%d", tr_torrentId( tor ) ), + tr_strdup_printf( "TR_TORRENT_HASH=%s", tor->info.hashString ), + tr_strdup_printf( "TR_TORRENT_NAME=%s", tr_torrentName( tor ) ), + NULL }; + + tr_torinf( tor, "Calling script \"%s\"", script ); + if( !fork( ) ) { execve( script, cmd, env ); - tr_torerr( tor, _( "Script failed with errno %d (%s)" ), errno, strerror(errno) ); _exit( 0 ); } }