patch-2.1.24 linux/drivers/char/softdog.c

Next file: linux/drivers/net/ppp.c
Previous file: linux/drivers/char/rtc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.23/linux/drivers/char/softdog.c linux/drivers/char/softdog.c
@@ -46,6 +46,7 @@
  
 struct timer_list watchdog_ticktock;
 static int timer_alive = 0;
+static int in_use = 0;
 
 
 /*
@@ -70,8 +71,9 @@
  
 static int softdog_open(struct inode *inode, struct file *file)
 {
-	if(timer_alive)
+	if(in_use)
 		return -EBUSY;
+	in_use = 1;
 	MOD_INC_USE_COUNT;
 	/*
 	 *	Activate timer
@@ -94,6 +96,7 @@
 	MOD_DEC_USE_COUNT;
 	timer_alive=0;
 #endif	
+	in_use = 0;
 }
 
 static void softdog_ping(void)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov