udev-event: fix timeout log messages

Follow-up for e81c3a4c5f.
This commit is contained in:
Yu Watanabe
2018-10-31 09:29:51 +09:00
parent 7af1c7808b
commit 4375dab58d
+4 -4
View File
@@ -475,26 +475,26 @@ static int on_spawn_io(sd_event_source *s, int fd, uint32_t revents, void *userd
static int on_spawn_timeout(sd_event_source *s, uint64_t usec, void *userdata) {
Spawn *spawn = userdata;
char timeout[FORMAT_TIMESTAMP_RELATIVE_MAX];
char timeout[FORMAT_TIMESPAN_MAX];
assert(spawn);
kill_and_sigcont(spawn->pid, SIGKILL);
log_error("Spawned process '%s' ["PID_FMT"] timed out after %s, killing", spawn->cmd, spawn->pid,
format_timestamp_relative(timeout, sizeof(timeout), spawn->timeout_usec));
format_timespan(timeout, sizeof(timeout), spawn->timeout_usec, USEC_PER_SEC));
return 1;
}
static int on_spawn_timeout_warning(sd_event_source *s, uint64_t usec, void *userdata) {
Spawn *spawn = userdata;
char timeout[FORMAT_TIMESTAMP_RELATIVE_MAX];
char timeout[FORMAT_TIMESPAN_MAX];
assert(spawn);
log_warning("Spawned process '%s' ["PID_FMT"] is taking longer than %s to complete", spawn->cmd, spawn->pid,
format_timestamp_relative(timeout, sizeof(timeout), spawn->timeout_warn_usec));
format_timespan(timeout, sizeof(timeout), spawn->timeout_warn_usec, USEC_PER_SEC));
return 1;
}