Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
650009b9
Commit
650009b9
authored
Jan 10, 2003
by
Dave Jones
Committed by
Dave Jones
Jan 10, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[WATCHDOG] softdog nowayout fixes from 2.4
parent
30bf63c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
drivers/char/watchdog/softdog.c
drivers/char/watchdog/softdog.c
+19
-0
No files found.
drivers/char/watchdog/softdog.c
View file @
650009b9
...
...
@@ -47,6 +47,7 @@
#define TIMER_MARGIN 60
/* (secs) Default is 1 minute */
static
int
expect_close
=
0
;
static
int
soft_margin
=
TIMER_MARGIN
;
/* in seconds */
MODULE_PARM
(
soft_margin
,
"i"
);
...
...
@@ -114,6 +115,8 @@ static int softdog_release(struct inode *inode, struct file *file)
*/
if
(
!
nowayout
)
{
del_timer
(
&
watchdog_ticktock
);
}
else
{
printk
(
KERN_CRIT
"SOFTDOG: WDT device closed unexpectedly. WDT will not stop!
\n
"
);
}
timer_alive
=
0
;
return
0
;
...
...
@@ -129,6 +132,21 @@ static ssize_t softdog_write(struct file *file, const char *data, size_t len, lo
* Refresh the timer.
*/
if
(
len
)
{
if
(
!
nowayout
)
{
size_t
i
;
/* In case it was set long ago */
expect_close
=
0
;
for
(
i
=
0
;
i
!=
len
;
i
++
)
{
char
c
;
if
(
get_user
(
c
,
data
+
i
))
return
-
EFAULT
;
if
(
c
==
'V'
)
expect_close
=
1
;
}
}
mod_timer
(
&
watchdog_ticktock
,
jiffies
+
(
soft_margin
*
HZ
));
return
1
;
}
...
...
@@ -139,6 +157,7 @@ static int softdog_ioctl(struct inode *inode, struct file *file,
unsigned
int
cmd
,
unsigned
long
arg
)
{
static
struct
watchdog_info
ident
=
{
.
options
=
WDIOF_SETTIMEOUT
|
WDIOF_MAGICCLOSE
,
.
identity
=
"Software Watchdog"
,
};
switch
(
cmd
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment