util-lib: unify parsing of nice level values

This adds parse_nice() that parses a nice level and ensures it is in the right
range, via a new nice_is_valid() helper. It then ports over a number of users
to this.

No functional changes.
This commit is contained in:
Lennart Poettering
2016-08-05 11:18:32 +02:00
parent 1ed1f50f82
commit 41bf0590cc
8 changed files with 78 additions and 30 deletions
+2
View File
@@ -108,3 +108,5 @@ int parse_fractional_part_u(const char **s, size_t digits, unsigned *res);
int parse_percent_unbounded(const char *p);
int parse_percent(const char *p);
int parse_nice(const char *p, int *ret);