diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2017-12-29 17:03:54 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-01-02 02:23:24 +0900 |
commit | 33d12153da4d3a90817cd9099962eb992f0131dd (patch) | |
tree | 60a8bd04d04a2eb1142fa7b9fda1b1ebd889c6c8 /src/basic/parse-util.c | |
parent | 6f90844fe29225d138ff1c286680250878ed3a0a (diff) | |
download | systemd-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.c | 3 |
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; |