(svn r16012) -Codechange: Code style clean up.

This commit is contained in:
peter1138
2009-04-10 11:03:48 +00:00
parent 9acb1dc3f2
commit 6bf1a49475
4 changed files with 23 additions and 11 deletions

View File

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