1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00

time-util: coding style fixes

Follow-ups for 45eb4d2261.
This commit is contained in:
Yu Watanabe 2021-06-21 17:54:05 +09:00 committed by Luca Boccassi
parent 932feb79b3
commit f75817172f

View File

@ -432,34 +432,34 @@ char *format_timestamp_relative(char *buf, size_t l, usec_t t) {
if (d >= USEC_PER_YEAR) {
usec_t years = d / USEC_PER_YEAR;
usec_t months = (d % USEC_PER_YEAR) / USEC_PER_MONTH;
snprintf(buf, l, USEC_FMT " %s " USEC_FMT " %s %s",
years,
years == 1 ? "year" : "years",
months,
months == 1 ? "month" : "months",
s);
}
else if (d >= USEC_PER_MONTH) {
} else if (d >= USEC_PER_MONTH) {
usec_t months = d / USEC_PER_MONTH;
usec_t days = (d % USEC_PER_MONTH) / USEC_PER_DAY;
snprintf(buf, l, USEC_FMT " %s " USEC_FMT " %s %s",
months,
months == 1 ? "month" : "months",
days,
days == 1 ? "day" : "days",
s);
}
else if (d >= USEC_PER_WEEK) {
} else if (d >= USEC_PER_WEEK) {
usec_t weeks = d / USEC_PER_WEEK;
usec_t days = (d % USEC_PER_WEEK) / USEC_PER_DAY;
snprintf(buf, l, USEC_FMT " %s " USEC_FMT " %s %s",
weeks,
weeks == 1 ? "week" : "weeks",
days,
days == 1 ? "day" : "days",
s);
}
else if (d >= 2*USEC_PER_DAY)
} else if (d >= 2*USEC_PER_DAY)
snprintf(buf, l, USEC_FMT " days %s", d / USEC_PER_DAY, s);
else if (d >= 25*USEC_PER_HOUR)
snprintf(buf, l, "1 day " USEC_FMT "h %s",