summaryrefslogtreecommitdiff
path: root/src/basic/parse-util.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2017-12-29 17:03:54 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-01-02 02:23:24 +0900
commit33d12153da4d3a90817cd9099962eb992f0131dd (patch)
tree60a8bd04d04a2eb1142fa7b9fda1b1ebd889c6c8 /src/basic/parse-util.c
parent6f90844fe29225d138ff1c286680250878ed3a0a (diff)
downloadsystemd-33d12153da4d3a90817cd9099962eb992f0131dd.tar.gz
basic: introduce *_to_string_with_check() functions
They are used in later commits.
Diffstat (limited to 'src/basic/parse-util.c')
-rw-r--r--src/basic/parse-util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c
index d03f60e01a..33f94f3fc2 100644
--- a/src/basic/parse-util.c
+++ b/src/basic/parse-util.c
@@ -283,7 +283,8 @@ int parse_errno(const char *t) {
if (r < 0)
return r;
- if (e < 0 || e > ERRNO_MAX)
+ /* 0 is also allowed here */
+ if (!errno_is_valid(e) && e != 0)
return -ERANGE;
return e;