Commit a74c51c3 authored by Wim Van Sebroeck's avatar Wim Van Sebroeck

[WATCHDOG] 2.6.0-rc1 i810-tco.c.nowayout.patch

Fix nowayout handling to the way all other watchdog-drivers do it
parent df21fd50
...@@ -197,7 +197,7 @@ static int i810tco_release (struct inode *inode, struct file *file) ...@@ -197,7 +197,7 @@ static int i810tco_release (struct inode *inode, struct file *file)
/* /*
* Shut off the timer. * Shut off the timer.
*/ */
if (tco_expect_close == 42 && !nowayout) { if (tco_expect_close == 42) {
tco_timer_stop (); tco_timer_stop ();
} else { } else {
tco_timer_reload (); tco_timer_reload ();
...@@ -217,17 +217,21 @@ static ssize_t i810tco_write (struct file *file, const char *data, ...@@ -217,17 +217,21 @@ static ssize_t i810tco_write (struct file *file, const char *data,
/* See if we got the magic character 'V' and reload the timer */ /* See if we got the magic character 'V' and reload the timer */
if (len) { if (len) {
size_t i; if (!nowayout) {
size_t i;
tco_expect_close = 0;
/* note: just in case someone wrote the magic character
/* scan to see whether or not we got the magic character */ * five months ago... */
for (i = 0; i != len; i++) { tco_expect_close = 0;
u8 c;
if(get_user(c, data+i)) /* scan to see whether or not we got the magic character */
return -EFAULT; for (i = 0; i != len; i++) {
if (c == 'V') u8 c;
tco_expect_close = 42; if(get_user(c, data+i))
return -EFAULT;
if (c == 'V')
tco_expect_close = 42;
}
} }
/* someone wrote to us, we should reload the timer */ /* someone wrote to us, we should reload the timer */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment