mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-24 21:34:08 +03:00
watchdog: minor optimization in watchdog_setup()
This commit is contained in:
parent
85e5613cf3
commit
fcbf2c64f5
@ -134,6 +134,10 @@ int watchdog_set_device(const char *path) {
|
||||
|
||||
int watchdog_setup(usec_t timeout) {
|
||||
|
||||
/* Let's shortcut duplicated requests */
|
||||
if (watchdog_fd >= 0 && watchdog_timeout == timeout)
|
||||
return 0;
|
||||
|
||||
/* Initialize the watchdog timeout with the caller value. This value is
|
||||
* going to be updated by update_timeout() with the closest value
|
||||
* supported by the driver */
|
||||
|
Loading…
Reference in New Issue
Block a user