sdlmusic.c: disable FORK_EXEC_MIDI.

Also, if it were to be reenabled again, use execv() instead of execvp(),
i.e. don't look up $PATH for the executable.

git-svn-id: https://svn.eduke32.com/eduke32@4167 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-11-16 18:47:23 +00:00
parent 863aae3fb1
commit 2972155f14

View file

@ -43,7 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "music.h" #include "music.h"
#if !defined _WIN32 && !defined(GEKKO) #if !defined _WIN32 && !defined(GEKKO)
# define FORK_EXEC_MIDI 1 //# define FORK_EXEC_MIDI 1
#endif #endif
#if defined FORK_EXEC_MIDI // fork/exec based external midi player #if defined FORK_EXEC_MIDI // fork/exec based external midi player
@ -216,15 +216,15 @@ int32_t MUSIC_Init(int32_t SoundCard, int32_t Address)
perror("MUSIC_Init: mprotect"); perror("MUSIC_Init: mprotect");
goto fallback; goto fallback;
} }
/* # if 0
{ {
int i; int i;
initprintf("----Music argv:\n"); initprintf("----Music argv:\n");
for (i=0; i<numargs+1; i++) for (i=0; i<numargs+1; i++)
initprintf(" %s\n", external_midi_argv[i]); initprintf(" %s\n", external_midi_argv[i]);
initprintf("----\n"); initprintf("----\n");
} }
*/ # endif
#endif #endif
music_initialized = 1; music_initialized = 1;
return(MUSIC_Ok); return(MUSIC_Ok);
@ -406,8 +406,8 @@ static void playmusic()
} }
else if (pid==0) // child else if (pid==0) // child
{ {
// exec with PATH lookup // exec without PATH lookup
if (execvp(external_midi_argv[0], external_midi_argv) < 0) if (execv(external_midi_argv[0], external_midi_argv) < 0)
{ {
perror("execv"); perror("execv");
_exit(1); _exit(1);