summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Levon <levon@movementarian.org>2003-05-03 04:42:19 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-05-03 04:42:19 -0700
commit4235c177db3c50c9884218e208cdc8407d80e532 (patch)
tree6984a58e3802b40aa043110b02614b692cf076ef
parent27c14ce8b04ac31d27e01620df812c29b5ef599e (diff)
[PATCH] OProfile update
If there's are multiple tasks sleeping inside the read routine ever, this is necessary.
-rw-r--r--drivers/oprofile/event_buffer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/oprofile/event_buffer.c b/drivers/oprofile/event_buffer.c
index 08c5647980f8..3df72441fa79 100644
--- a/drivers/oprofile/event_buffer.c
+++ b/drivers/oprofile/event_buffer.c
@@ -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);