[PATCH] watchdog add settimeout ioctl

Darius augulis.darius at gmail.com
Tue Aug 5 13:05:11 UTC 2008


Tito wrote:
> On Tuesday 05 August 2008 13:18:06 Darius wrote:
>> Hi All,
>>
>> this patch adds one more command line option for watchdog utility and small
>> ioctl implementation for hardware WD timer setting. Now it is possible to
>> set up userspace and hardware timers independently with different values.
>>
>> BR,
>> Darius Augulis
> Hi,
> maybe you can you use this little optimization.
> 
> -	if (ioctl(3, WDIOC_SETTIMEOUT, &htimer_duration) != 0){
> -		printf("error setting hardware timer!\n");
> -		if (ioctl(3, WDIOC_GETTIMEOUT, &htimer_duration) != 0)
> -			printf("ioctl not supported by device!\n");
> -	}
> +bb_ioctl_or_warn(3, WDIOC_SETTIMEOUT,  &htimer_duration);
> +bb_ioctl_or_warn(3, WDIOC_GETTIMEOUT,  &htimer_duration);
> 
> This is untested. You should test what happens with htimer_duration
> if one of the calls fails and if this could affect somehow the subsequent
> 

Ok, thanks. Attached new patch with this optimization.
Tested in both cases when neither SETTIMEOUT nor GETTIMEOUT ioctls are not available in WD driver.
Works ok.

BR,
Darius



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch-busybox-watchdog-timeout
Url: http://lists.busybox.net/pipermail/busybox/attachments/20080805/e1b1a500/attachment.diff 


More information about the busybox mailing list