OSDN Git Service

Added SND_CTL_READONLY
authorJaroslav Kysela <perex@perex.cz>
Wed, 4 Dec 2002 14:36:39 +0000 (14:36 +0000)
committerJaroslav Kysela <perex@perex.cz>
Wed, 4 Dec 2002 14:36:39 +0000 (14:36 +0000)
include/control.h
src/control/control_hw.c
src/dlmisc.c

index 49ef4fb..c333899 100644 (file)
@@ -180,6 +180,9 @@ typedef enum _snd_ctl_type {
 /** Async notification (flag for open mode) \hideinitializer */
 #define SND_CTL_ASYNC                  0x0002
 
+/** Read only (flag for open mode) \hideinitializer */
+#define SND_CTL_READONLY               0x0004
+
 /** CTL handle */
 typedef struct _snd_ctl snd_ctl_t;
 
index a3ac8ca..f62174d 100644 (file)
@@ -302,7 +302,10 @@ int snd_ctl_hw_open(snd_ctl_t **handle, const char *name, int card, int mode)
 
        assert(card >= 0 && card < 32);
        sprintf(filename, SNDRV_FILE_CONTROL, card);
-       fmode = O_RDWR;
+       if (mode & SND_CTL_READONLY)
+               fmode = O_RDONLY;
+       else
+               fmode = O_RDWR;
        if (mode & SND_CTL_NONBLOCK)
                fmode |= O_NONBLOCK;
        if (mode & SND_CTL_ASYNC)
index d275ad6..a5d174d 100644 (file)
@@ -48,8 +48,6 @@ struct snd_dlsym_link *snd_dlsym_start = NULL;
  */
 void *snd_dlopen(const char *name, int mode)
 {
-       void *res;
-
 #ifndef PIC
        if (name == NULL)
                return &snd_dlsym_start;