|
|
@@ -277,8 +277,8 @@ static ssize_t watchdog_read(struct file *file, char __user *user_buf,
|
|
|
char status_buf[64];
|
|
|
int len;
|
|
|
|
|
|
- if (*ppos > 0)
|
|
|
- return 0;
|
|
|
+ // if (*ppos > 0)
|
|
|
+ // return 0;
|
|
|
|
|
|
mutex_lock(&watchdog_mutex);
|
|
|
if (watchdog_state)
|
|
|
@@ -287,12 +287,22 @@ static ssize_t watchdog_read(struct file *file, char __user *user_buf,
|
|
|
else
|
|
|
len = snprintf(status_buf, sizeof(status_buf),
|
|
|
"The watchdog is off\nThe args value is 0\n");
|
|
|
+ memset(status_buf, 0, sizeof(status_buf));
|
|
|
+ if( watchdog_state == 1)
|
|
|
+ {
|
|
|
+ status_buf[0] = '1';
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ status_buf[0] = '0';
|
|
|
+ }
|
|
|
+ len = 1;
|
|
|
mutex_unlock(&watchdog_mutex);
|
|
|
|
|
|
if (copy_to_user(user_buf, status_buf, len))
|
|
|
return -EFAULT;
|
|
|
|
|
|
- *ppos += len;
|
|
|
+ // *ppos += len;
|
|
|
return len;
|
|
|
}
|
|
|
|