summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-07-01 14:32:46 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-07-09 11:03:36 +0200
commit5291f26d4a6450d1fbf3656640ef20c5e78aa6a5 (patch)
tree9eb548b3f97f16b6b521c7481fec65e451f600a4 /src/udev
parent5e62ac8b512ee801f92146e1a144c4077a672d8a (diff)
downloadsystemd-5291f26d4a6450d1fbf3656640ef20c5e78aa6a5.tar.gz
tree-wide: add FORMAT_TIMESPAN()
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/udev-event.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
index b28089be71..c31d4851a0 100644
--- a/src/udev/udev-event.c
+++ b/src/udev/udev-event.c
@@ -600,7 +600,6 @@ reenable:
static int on_spawn_timeout(sd_event_source *s, uint64_t usec, void *userdata) {
Spawn *spawn = userdata;
- char timeout[FORMAT_TIMESPAN_MAX];
assert(spawn);
@@ -610,20 +609,19 @@ static int on_spawn_timeout(sd_event_source *s, uint64_t usec, void *userdata) {
log_device_error(spawn->device, "Spawned process '%s' ["PID_FMT"] timed out after %s, killing",
spawn->cmd, spawn->pid,
- format_timespan(timeout, sizeof(timeout), spawn->timeout_usec, USEC_PER_SEC));
+ FORMAT_TIMESPAN(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_TIMESPAN_MAX];
assert(spawn);
log_device_warning(spawn->device, "Spawned process '%s' ["PID_FMT"] is taking longer than %s to complete",
spawn->cmd, spawn->pid,
- format_timespan(timeout, sizeof(timeout), spawn->timeout_warn_usec, USEC_PER_SEC));
+ FORMAT_TIMESPAN(spawn->timeout_warn_usec, USEC_PER_SEC));
return 1;
}
@@ -1080,10 +1078,8 @@ void udev_event_execute_run(UdevEvent *event, usec_t timeout_usec, int timeout_s
log_device_debug_errno(event->dev, r, "Failed to run built-in command \"%s\", ignoring: %m", command);
} else {
if (event->exec_delay_usec > 0) {
- char buf[FORMAT_TIMESPAN_MAX];
-
log_device_debug(event->dev, "Delaying execution of \"%s\" for %s.",
- command, format_timespan(buf, sizeof(buf), event->exec_delay_usec, USEC_PER_SEC));
+ command, FORMAT_TIMESPAN(event->exec_delay_usec, USEC_PER_SEC));
(void) usleep(event->exec_delay_usec);
}