aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-07-12 02:34:23 +0000
committerEric Wong <normalperson@yhbt.net>2006-07-12 02:34:23 +0000
commitdb2f8439952c771ca1d560df9057c81ed4ca8293 (patch)
treedf8d803cbaa01c62eba4907fb17e528beaf104ed
parentd8d6b949c6e6ed8f59d8436054bbc10a941305b5 (diff)
downloadmpd-db2f8439952c771ca1d560df9057c81ed4ca8293.tar.gz
mpd-db2f8439952c771ca1d560df9057c81ed4ca8293.tar.xz
mpd-db2f8439952c771ca1d560df9057c81ed4ca8293.zip
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
-rw-r--r--src/audioOutputs/audioOutput_oss.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/audioOutputs/audioOutput_oss.c b/src/audioOutputs/audioOutput_oss.c
index ee3f4e19a..2194b83ae 100644
--- a/src/audioOutputs/audioOutput_oss.c
+++ b/src/audioOutputs/audioOutput_oss.c
@@ -2,7 +2,8 @@
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
* 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
* it under the terms of the GNU General Public License as published by
@@ -302,7 +303,7 @@ static int oss_testDefault() {
fd = open("/dev/sound/dsp", O_WRONLY);
- if(fd) {
+ if(fd >= 0) {
close(fd);
return 0;
}
@@ -312,7 +313,7 @@ static int oss_testDefault() {
fd = open("/dev/dsp", O_WRONLY);
- if(fd) {
+ if(fd >= 0) {
close(fd);
return 0;
}