Commit db2f8439 authored by Eric Wong's avatar Eric Wong

OSS: correctly check for the device in oss_testDefault()

open(2) returns -1 on error (if the device does not exist), and -1 is true. Also, put shank's name in the copyright header since half the code is his (including this bug :P). git-svn-id: https://svn.musicpd.org/mpd/trunk@4310 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent d8d6b949
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu) * (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
* This project's homepage is: http://www.musicpd.org * This project's homepage is: http://www.musicpd.org
* *
* OSS audio output (c) 2004 by Eric Wong <eric@petta-tech.com> * OSS audio output (c) 2004, 2005, 2006 by Eric Wong <eric@petta-tech.com>
* and Warren Dukes <warren.dukes@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -302,7 +303,7 @@ static int oss_testDefault() { ...@@ -302,7 +303,7 @@ static int oss_testDefault() {
fd = open("/dev/sound/dsp", O_WRONLY); fd = open("/dev/sound/dsp", O_WRONLY);
if(fd) { if(fd >= 0) {
close(fd); close(fd);
return 0; return 0;
} }
...@@ -312,7 +313,7 @@ static int oss_testDefault() { ...@@ -312,7 +313,7 @@ static int oss_testDefault() {
fd = open("/dev/dsp", O_WRONLY); fd = open("/dev/dsp", O_WRONLY);
if(fd) { if(fd >= 0) {
close(fd); close(fd);
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment