summaryrefslogtreecommitdiff
path: root/src/basic/time-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-12-06 10:51:26 +0100
committerMartin Pitt <martin.pitt@ubuntu.com>2016-12-06 10:51:26 +0100
commit5efdbf11d1ef7da72d3de58abecd84edefbaf98a (patch)
tree2e3128ccf41aa60c8e2826e76c15404848655202 /src/basic/time-util.c
parent471b9850ee10dea07233af485e125897d2d35a00 (diff)
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.
Diffstat (limited to 'src/basic/time-util.c')
-rw-r--r--src/basic/time-util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/basic/time-util.c b/src/basic/time-util.c
index cbdfd55ada..7a5b29d77e 100644
--- a/src/basic/time-util.c
+++ b/src/basic/time-util.c
@@ -883,6 +883,7 @@ static char* extract_multiplier(char *p, usec_t *multiplier) {
{ "y", USEC_PER_YEAR },
{ "usec", 1ULL },
{ "us", 1ULL },
+ { "µs", 1ULL },
};
unsigned i;
@@ -1016,6 +1017,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 */