This extends
2d79a0bbb9f651656384a0a86ed814e6306fb5dd to the kernel
command line parsing.
The parsing is changed a bit to only understand "0" as infinity. If units are
specified, parse normally, e.g. "0s" is just 0. This makes it possible to
provide a zero timeout if necessary.
Simple test is added.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=
1462378.
}
#if 0 /// UNNEEDED by elogind
+int parse_sec_fix_0(const char *t, usec_t *usec) {
+ t += strspn(t, WHITESPACE);
+ if (streq(t, "0")) {
+ *usec = USEC_INFINITY;
+ return 0;
+ }
+
+ return parse_sec(t, usec);
+}
+
int parse_nsec(const char *t, nsec_t *nsec) {
static const struct {
const char *suffix;
#endif // 0
int parse_sec(const char *t, usec_t *usec);
+#if 0 /// UNNEEDED by elogind
+int parse_sec_fix_0(const char *t, usec_t *usec);
+#endif // 0
int parse_time(const char *t, usec_t *usec, usec_t default_unit);
#if 0 /// UNNEEDED by elogind
int parse_nsec(const char *t, nsec_t *nsec);