diff options
author | Domen Puncer <domen@coderock.org> | 2005-06-25 17:58:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-25 19:24:58 -0400 |
commit | b20f3ae5f0efe1812d2a1278e2127a335884d445 (patch) | |
tree | 7865a5e6e99ea4acc20844a95947110a768e69b1 /drivers | |
parent | d8eddb620499dc638aeb4d5d3751974ca697ab39 (diff) |
[PATCH] char/tty_io: replace schedule_timeout() with msleep_interruptible()
Use msleep_interruptible() instead of schedule_timeout() in send_break() to
guarantee the task delays as expected. Change @duration's units to
milliseconds, and modify arguments in callers appropriately. Patch is
compile-tested.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/tty_io.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index cc4b43bad703..6e4be3bb2d89 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -94,6 +94,7 @@ | |||
94 | #include <linux/idr.h> | 94 | #include <linux/idr.h> |
95 | #include <linux/wait.h> | 95 | #include <linux/wait.h> |
96 | #include <linux/bitops.h> | 96 | #include <linux/bitops.h> |
97 | #include <linux/delay.h> | ||
97 | 98 | ||
98 | #include <asm/uaccess.h> | 99 | #include <asm/uaccess.h> |
99 | #include <asm/system.h> | 100 | #include <asm/system.h> |
@@ -2180,12 +2181,11 @@ static int tiocsetd(struct tty_struct *tty, int __user *p) | |||
2180 | return tty_set_ldisc(tty, ldisc); | 2181 | return tty_set_ldisc(tty, ldisc); |
2181 | } | 2182 | } |
2182 | 2183 | ||
2183 | static int send_break(struct tty_struct *tty, int duration) | 2184 | static int send_break(struct tty_struct *tty, unsigned int duration) |
2184 | { | 2185 | { |
2185 | tty->driver->break_ctl(tty, -1); | 2186 | tty->driver->break_ctl(tty, -1); |
2186 | if (!signal_pending(current)) { | 2187 | if (!signal_pending(current)) { |
2187 | set_current_state(TASK_INTERRUPTIBLE); | 2188 | msleep_interruptible(duration); |
2188 | schedule_timeout(duration); | ||
2189 | } | 2189 | } |
2190 | tty->driver->break_ctl(tty, 0); | 2190 | tty->driver->break_ctl(tty, 0); |
2191 | if (signal_pending(current)) | 2191 | if (signal_pending(current)) |
@@ -2366,10 +2366,10 @@ int tty_ioctl(struct inode * inode, struct file * file, | |||
2366 | * all by anyone? | 2366 | * all by anyone? |
2367 | */ | 2367 | */ |
2368 | if (!arg) | 2368 | if (!arg) |
2369 | return send_break(tty, HZ/4); | 2369 | return send_break(tty, 250); |
2370 | return 0; | 2370 | return 0; |
2371 | case TCSBRKP: /* support for POSIX tcsendbreak() */ | 2371 | case TCSBRKP: /* support for POSIX tcsendbreak() */ |
2372 | return send_break(tty, arg ? arg*(HZ/10) : HZ/4); | 2372 | return send_break(tty, arg ? arg*100 : 250); |
2373 | 2373 | ||
2374 | case TIOCMGET: | 2374 | case TIOCMGET: |
2375 | return tty_tiocmget(tty, file, p); | 2375 | return tty_tiocmget(tty, file, p); |