Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
systemd-mini.1472
0002-time-also-support-infinity-syntax-in-parse...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0002-time-also-support-infinity-syntax-in-parse_nsec.patch of Package systemd-mini.1472
Based on e73c78c27511b03c7abc55aed87896092c0de699 Mon Sep 17 00:00:00 2001 From: Lennart Poettering <lennart@poettering.net> Date: Fri, 24 Oct 2014 19:07:26 +0200 Subject: [PATCH] time: also support 'infinity' syntax in parse_nsec() Let's make parse_usec() and parse_nsec() work similar --- src/shared/time-util.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) --- src/shared/time-util.c +++ src/shared/time-util.c @@ -773,7 +773,7 @@ int parse_nsec(const char *t, nsec_t *nsec) { { "", 1ULL }, /* default is nsec */ }; - const char *p; + const char *p, *s; nsec_t r = 0; bool something = false; @@ -781,6 +781,18 @@ int parse_nsec(const char *t, nsec_t *nsec) { assert(nsec); p = t; + + p += strspn(p, WHITESPACE); + s = startswith(p, "infinity"); + if (s) { + s += strspn(s, WHITESPACE); + if (!*s != 0) + return -EINVAL; + + *nsec = ((nsec_t) -1); + return 0; + } + for (;;) { long long l, z = 0; char *e;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor