]> granicus.if.org Git - transmission/commitdiff
(trunk libT) #3764 "script-torrent-done shouldn't block libtransmission" -- add the...
authorCharles Kerr <charles@transmissionbt.com>
Wed, 15 Dec 2010 14:55:20 +0000 (14:55 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Wed, 15 Dec 2010 14:55:20 +0000 (14:55 +0000)
libtransmission/torrent.c

index 8eba2276e043614ac69142a7398af5f2949976dd..fe94c403605feee94672d4b4506f9aeed7731a38 100644 (file)
@@ -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 );
         }
     }