kernels/linux-2.4.0/drivers/char/softdog.c
/*
 *	Allow only one person to hold it open
 */
Allow only one person to hold it open
Allow only one person to hold it open
static int softdog_open(struct inode *inode, struct file *file)
{
	if(timer_alive)
		return -EBUSY;
#ifdef CONFIG_WATCHDOG_NOWAYOUT	 
	MOD_INC_USE_COUNT;
#endif	
	mod_timer(&watchdog_ticktock, jiffies+(soft_margin*HZ));
	timer_alive=1;
	return 0;
}
static int softdog_open ( struct inode * inode , struct file * file ) { if ( timer_alive ) return - EBUSY ; #ifdef CONFIG_WATCHDOG_NOWAYOUT MOD_INC_USE_COUNT ; #endif mod_timer ( & watchdog_ticktock , jiffies + ( soft_margin * HZ ) ) ; timer_alive = 1 ; return 0 ; }
Allow only one person to hold it open
Allow only one person to hold it open
/*
	 *	Activate timer
	 */