From 6bf1a494756aaf38c947ae06863f5ebe89c2614c Mon Sep 17 00:00:00 2001 From: peter1138 Date: Fri, 10 Apr 2009 11:03:48 +0000 Subject: (svn r16012) -Codechange: Code style clean up. --- src/music/extmidi.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/music/extmidi.cpp') diff --git a/src/music/extmidi.cpp b/src/music/extmidi.cpp index c3af20140..0bcb1cdd7 100644 --- a/src/music/extmidi.cpp +++ b/src/music/extmidi.cpp @@ -52,8 +52,9 @@ void MusicDriver_ExtMidi::StopSong() bool MusicDriver_ExtMidi::IsSongPlaying() { - if (this->pid != -1 && waitpid(this->pid, NULL, WNOHANG) == this->pid) + if (this->pid != -1 && waitpid(this->pid, NULL, WNOHANG) == this->pid) { this->pid = -1; + } if (this->pid == -1 && this->song[0] != '\0') this->DoPlay(); return this->pid != -1; } @@ -68,10 +69,8 @@ void MusicDriver_ExtMidi::DoPlay() this->pid = fork(); switch (this->pid) { case 0: { - int d; - close(0); - d = open("/dev/null", O_RDONLY); + int d = open("/dev/null", O_RDONLY); if (d != -1 && dup2(d, 1) != -1 && dup2(d, 2) != -1) { #if defined(MIDI_ARG) execlp(this->command, "extmidi", MIDI_ARG, this->song, (char*)0); -- cgit v1.2.3-54-g00ecf