Disable the software watchdog. */
| 1965 | |
| 1966 | /* Disable the software watchdog. */ |
| 1967 | void disableWatchdog(void) { |
| 1968 | struct sigaction act; |
| 1969 | if (server.watchdog_period == 0) return; /* Already disabled. */ |
| 1970 | watchdogScheduleSignal(0); /* Stop the current timer. */ |
| 1971 | |
| 1972 | /* Set the signal handler to SIG_IGN, this will also remove pending |
| 1973 | * signals from the queue. */ |
| 1974 | sigemptyset(&act.sa_mask); |
| 1975 | act.sa_flags = 0; |
| 1976 | act.sa_handler = SIG_IGN; |
| 1977 | sigaction(SIGALRM, &act, NULL); |
| 1978 | server.watchdog_period = 0; |
| 1979 | } |
| 1980 | |
| 1981 | /* Positive input is sleep time in microseconds. Negative input is fractions |
| 1982 | * of microseconds, i.e. -10 means 100 nanoseconds. */ |
no test coverage detected