# HG changeset patch # User tron # Date 1126518836 0 # Node ID e885ba7ba1e247486520a16da4e8630f9194f142 # Parent a2572881fd7c03d5f7aed2805e515e499e206d53 (svn r2946) Remove redundant calls, simplify a check and terminate the argument list of execlp() as suggested by the manpage to make it correctly work on 64bit platforms diff -r a2572881fd7c -r e885ba7ba1e2 music/extmidi.c --- a/music/extmidi.c Sun Sep 11 18:36:22 2005 +0000 +++ b/music/extmidi.c Mon Sep 12 09:53:56 2005 +0000 @@ -69,17 +69,13 @@ int d; close(0); - close(1); - close(2); d = open("/dev/null", O_RDONLY); - if (d != -1) { - if (dup2(d, 1) != -1 && dup2(d, 2) != -1) { - #if defined(MIDI_ARG) - execlp(msf.extmidi, "extmidi", MIDI_ARG, _midi.song, NULL); - #else - execlp(msf.extmidi, "extmidi", _midi.song, NULL); - #endif - } + if (d != -1 && dup2(d, 1) != -1 && dup2(d, 2) != -1) { + #if defined(MIDI_ARG) + execlp(msf.extmidi, "extmidi", MIDI_ARG, _midi.song, (char*)0); + #else + execlp(msf.extmidi, "extmidi", _midi.song, (char*)0); + #endif } _exit(1); }