From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57088) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeNpX-0000f0-EE for qemu-devel@nongnu.org; Thu, 07 Nov 2013 06:33:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VeNpR-00070k-Ey for qemu-devel@nongnu.org; Thu, 07 Nov 2013 06:32:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeNpR-00070L-7h for qemu-devel@nongnu.org; Thu, 07 Nov 2013 06:32:49 -0500 From: Gerd Hoffmann Date: Thu, 7 Nov 2013 12:32:27 +0100 Message-Id: <1383823947-5132-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1383823947-5132-1-git-send-email-kraxel@redhat.com> References: <1383823947-5132-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] ossaudio: check for oss support in oss_audio_init List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Vassili Karpov (malc)" , Gerd Hoffmann , Anthony Liguori Check whenever the device path (/dev/dsp by default) exists and qemu is allowed to access it. Return NULL if it isn't, so ossaudio will not be used on systems wihtout oss support (increasinly common on modern linux systems). Signed-off-by: Gerd Hoffmann --- audio/ossaudio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/audio/ossaudio.c b/audio/ossaudio.c index 007c641..5a73716 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -849,6 +849,10 @@ static int oss_ctl_in (HWVoiceIn *hw, int cmd, ...) static void *oss_audio_init (void) { + if (access(conf.devpath_in, R_OK | W_OK) < 0 || + access(conf.devpath_out, R_OK | W_OK) < 0) { + return NULL; + } return &conf; } -- 1.8.3.1