summaryrefslogtreecommitdiff
path: root/src/shared/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-11 18:35:54 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-11 18:35:54 +0200
commit7e8185ef942de5acecfa4cda03d7d7711ddda992 (patch)
treedf2d7989fb1769e9ea9d3981d7d1a55b4f59f876 /src/shared/util.c
parentd7bf74d9cccdc6ffa567ea0e08f814863610f88e (diff)
fix a couple of more lazy "return -1"
Fix should strictly follow the rule to return negative errno-style error codes from functions, hence let's fix more "return -1"-style lazinesses.
Diffstat (limited to 'src/shared/util.c')
-rw-r--r--src/shared/util.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 586f17af83..347fa12098 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -1083,7 +1083,7 @@ int unhexchar(char c) {
if (c >= 'A' && c <= 'F')
return c - 'A' + 10;
- return -1;
+ return -EINVAL;
}
char *hexmem(const void *p, size_t l) {
@@ -1138,7 +1138,7 @@ int unoctchar(char c) {
if (c >= '0' && c <= '7')
return c - '0';
- return -1;
+ return -EINVAL;
}
char decchar(int x) {
@@ -1150,7 +1150,7 @@ int undecchar(char c) {
if (c >= '0' && c <= '9')
return c - '0';
- return -1;
+ return -EINVAL;
}
char *cescape(const char *s) {
@@ -4956,7 +4956,7 @@ int signal_from_string(const char *s) {
if (signo > 0 && signo < _NSIG)
return signo;
}
- return -1;
+ return -EINVAL;
}
bool kexec_loaded(void) {