basic/rlimit-util.c: drop duplicate checks
parse_sec() and parse_time() already handle "infinity". TEST(rlimit_parse_format) covered the first case, also extend it to cover the second case.
This commit is contained in:
@@ -131,11 +131,6 @@ static int rlimit_parse_sec(const char *val, rlim_t *ret) {
|
||||
assert(val);
|
||||
assert(ret);
|
||||
|
||||
if (streq(val, "infinity")) {
|
||||
*ret = RLIM_INFINITY;
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = parse_sec(val, &t);
|
||||
if (r < 0)
|
||||
return r;
|
||||
@@ -159,11 +154,6 @@ static int rlimit_parse_usec(const char *val, rlim_t *ret) {
|
||||
assert(val);
|
||||
assert(ret);
|
||||
|
||||
if (streq(val, "infinity")) {
|
||||
*ret = RLIM_INFINITY;
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = parse_time(val, &t, 1);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user