From: Lennart Poettering Date: Tue, 6 Dec 2016 09:51:26 +0000 (+0100) Subject: time-util: accept "µs" as time unit, in addition to "us" (#4836) X-Git-Tag: v233.3~131 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;ds=inline;h=8f89cf7c426de33660e8350084bad845cbc47d17;p=elogind.git time-util: accept "µs" as time unit, in addition to "us" (#4836) Let's accept "µs" as alternative time unit for microseconds. We already accept "us" and "usec" for them, lets extend on this and accept the proper scientific unit specification too. We will never output this as time unit, but it's fine to accept it, after all we are pretty permissive with time units already. --- diff --git a/src/basic/time-util.c b/src/basic/time-util.c index 7ee048425..467503c1b 100644 --- a/src/basic/time-util.c +++ b/src/basic/time-util.c @@ -897,6 +897,7 @@ static char* extract_multiplier(char *p, usec_t *multiplier) { { "y", USEC_PER_YEAR }, { "usec", 1ULL }, { "us", 1ULL }, + { "µs", 1ULL }, }; unsigned i; @@ -1031,6 +1032,7 @@ int parse_nsec(const char *t, nsec_t *nsec) { { "y", NSEC_PER_YEAR }, { "usec", NSEC_PER_USEC }, { "us", NSEC_PER_USEC }, + { "µs", NSEC_PER_USEC }, { "nsec", 1ULL }, { "ns", 1ULL }, { "", 1ULL }, /* default is nsec */