This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / char / ftape / lowlevel / ftape-io.c
index b7910d4..bd3b2f1 100644 (file)
@@ -32,7 +32,6 @@
 #include <asm/system.h>
 #include <linux/ioctl.h>
 #include <linux/mtio.h>
-#include <linux/delay.h>
 
 #include <linux/ftape.h>
 #include <linux/qic117.h>
@@ -97,12 +96,19 @@ void ftape_sleep(unsigned int time)
                timeout = ticks;
                save_flags(flags);
                sti();
-               msleep_interruptible(jiffies_to_msecs(timeout));
-               /*  Mmm. Isn't current->blocked == 0xffffffff ?
-                */
-               if (signal_pending(current)) {
-                       TRACE(ft_t_err, "awoken by non-blocked signal :-(");
-               }
+               set_current_state(TASK_INTERRUPTIBLE);
+               do {
+                       /*  Mmm. Isn't current->blocked == 0xffffffff ?
+                        */
+                       if (signal_pending(current)) {
+                               TRACE(ft_t_err,
+                                     "awoken by non-blocked signal :-(");
+                               break;  /* exit on signal */
+                       }
+                       while (current->state != TASK_RUNNING) {
+                               timeout = schedule_timeout(timeout);
+                       }
+               } while (timeout);
                restore_flags(flags);
        }
        TRACE_EXIT;