Use msleep_interruptible() instead of schedule_timeout() to guarantee
the task delays as expected. Change the units of poll_interval to
msecs as it is only used in this delay.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
                return -ENODEV;
        }
 
-       poll_interval = 5 * HZ; /* TODO env_mon_interval */
+       poll_interval = 5000; /* TODO env_mon_interval */
 
        daemonize("kenvctrld");
        allow_signal(SIGKILL);
 
        printk(KERN_INFO "envctrl: %s starting...\n", current->comm);
        for (;;) {
-               current->state = TASK_INTERRUPTIBLE;
-               schedule_timeout(poll_interval);
-
-               if(signal_pending(current))
+               if(msleep_interruptible(poll_interval))
                        break;
 
                for (whichcpu = 0; whichcpu < ENVCTRL_MAX_CPU; ++whichcpu) {