Added SND_CTL_READONLY

This commit is contained in:
Jaroslav Kysela 2002-12-04 14:36:39 +00:00
parent 098932ce57
commit 7fcea07002
3 changed files with 7 additions and 3 deletions

View 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;

View 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)

View 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;