diff options
-rw-r--r-- | io-module/mts_io.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/io-module/mts_io.c b/io-module/mts_io.c index 6ce8981..12650b1 100644 --- a/io-module/mts_io.c +++ b/io-module/mts_io.c @@ -106,6 +106,7 @@ static DEFINE_MUTEX(mts_io_mutex); static pid_t reset_pid = -1; static pid_t reset_count = 0; +bool sent_extra_long = false; static int reset_short_signal = SIGUSR1; static int reset_long_signal = SIGUSR2; static int reset_extra_long_signal = SIGHUP; @@ -138,16 +139,16 @@ static void reset_callback(struct work_struct *ignored) //Reset button has not been pressed if (reset_count > 0 && reset_count < RESET_HOLD_COUNT) { kill_pid(vpid, reset_short_signal, 1); - reset_count = 0; } else if (reset_count >= RESET_HOLD_COUNT && reset_count < RESET_LONG_HOLD_COUNT) { - reset_count = 0; kill_pid(vpid, reset_long_signal, 1); } - } - if (reset_count >= RESET_LONG_HOLD_COUNT) { reset_count = 0; + sent_extra_long = false; + } + if (reset_count >= RESET_LONG_HOLD_COUNT && ! sent_extra_long) { kill_pid(vpid, reset_extra_long_signal, 1); + sent_extra_long = true; } } else { reset_count = 0; |