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);
{
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