]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/oss/dmasound/dmasound_core.c
oss: fix O_NONBLOCK in dmasound_core
[linux-2.6-omap-h63xx.git] / sound / oss / dmasound / dmasound_core.c
index 95fc5c681755eafff96d7165c1eeb3b9da72a781..793b7f4784332b1c039f7f4153ff9aafb87cd5a8 100644 (file)
@@ -212,7 +212,7 @@ static int irq_installed;
 #endif /* MODULE */
 
 /* control over who can modify resources shared between play/record */
-static mode_t shared_resource_owner;
+static fmode_t shared_resource_owner;
 static int shared_resources_initialised;
 
     /*
@@ -603,7 +603,7 @@ static ssize_t sq_write(struct file *file, const char __user *src, size_t uLeft,
        while (uLeft) {
                while (write_sq.count >= write_sq.max_active) {
                        sq_play();
-                       if (write_sq.open_mode & O_NONBLOCK)
+                       if (write_sq.non_blocking)
                                return uWritten > 0 ? uWritten : -EAGAIN;
                        SLEEP(write_sq.action_queue);
                        if (signal_pending(current))
@@ -668,7 +668,7 @@ static inline void sq_init_waitqueue(struct sound_queue *sq)
 
 #if 0 /* blocking open() */
 static inline void sq_wake_up(struct sound_queue *sq, struct file *file,
-                             mode_t mode)
+                             fmode_t mode)
 {
        if (file->f_mode & mode) {
                sq->busy = 0; /* CHECK: IS THIS OK??? */
@@ -677,7 +677,7 @@ static inline void sq_wake_up(struct sound_queue *sq, struct file *file,
 }
 #endif
 
-static int sq_open2(struct sound_queue *sq, struct file *file, mode_t mode,
+static int sq_open2(struct sound_queue *sq, struct file *file, fmode_t mode,
                    int numbufs, int bufsize)
 {
        int rc = 0;
@@ -718,7 +718,7 @@ static int sq_open2(struct sound_queue *sq, struct file *file, mode_t mode,
                        return rc;
                }
 
-               sq->open_mode = file->f_mode;
+               sq->non_blocking = file->f_flags & O_NONBLOCK;
        }
        return rc;
 }
@@ -891,10 +891,10 @@ static int sq_release(struct inode *inode, struct file *file)
    is the owner - if we have problems.
 */
 
-static int shared_resources_are_mine(mode_t md)
+static int shared_resources_are_mine(fmode_t md)
 {
        if (shared_resource_owner)
-               return (shared_resource_owner & md ) ;
+               return (shared_resource_owner & md) != 0;
        else {
                shared_resource_owner = md ;
                return 1 ;