diff --git a/tools/dmsetup.c b/tools/dmsetup.c index 9876bd27a..459639b4b 100644 --- a/tools/dmsetup.c +++ b/tools/dmsetup.c @@ -637,6 +637,12 @@ static int _update_interval_times(void) uint64_t delta_t; int r = 0; + /* + * Clock shutdown for exit - nothing to do. + */ + if (_timer_fd == TIMER_STOPPED && !_cycle_timestamp) + return 1; + /* * Current timestamp. If _new_interval is set this is used as * the new cycle start timestamp. @@ -717,6 +723,9 @@ out: if (_cycle_timestamp) dm_timestamp_destroy(_cycle_timestamp); dm_timestamp_destroy(this_timestamp); + + /* Clear timestamp pointers to signal shutdown. */ + _cycle_timestamp = this_timestamp = NULL; } return r; }