]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] OProfile update
authorJohn Levon <levon@movementarian.org>
Sat, 3 May 2003 11:42:19 +0000 (04:42 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sat, 3 May 2003 11:42:19 +0000 (04:42 -0700)
If there's are multiple tasks sleeping inside the read routine ever, this is necessary.

drivers/oprofile/event_buffer.c

index 08c5647980f8e2716013fefbb3e5990ad79c6a14..3df72441fa79bf5a39756ed96a273d67cde34702 100644 (file)
@@ -151,11 +151,15 @@ ssize_t event_buffer_read(struct file * file, char * buf, size_t count, loff_t *
        if (count != max || *offset)
                return -EINVAL;
 
-       /* wait for the event buffer to fill up with some data */
        wait_event_interruptible(buffer_wait, atomic_read(&buffer_ready));
+
        if (signal_pending(current))
                return -EINTR;
 
+       /* can't currently happen */
+       if (!atomic_read(&buffer_ready))
+               return -EAGAIN;
+
        down(&buffer_sem);
 
        atomic_set(&buffer_ready, 0);