summaryrefslogtreecommitdiff
path: root/src/shared/device-nodes.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/device-nodes.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/device-nodes.c')
-rw-r--r--src/shared/device-nodes.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/device-nodes.c b/src/shared/device-nodes.c
index 9837375099..73e9edd29d 100644
--- a/src/shared/device-nodes.c
+++ b/src/shared/device-nodes.c
@@ -41,7 +41,7 @@ int encode_devnode_name(const char *str, char *str_enc, size_t len) {
size_t i, j;
if (str == NULL || str_enc == NULL)
- return -1;
+ return -EINVAL;
for (i = 0, j = 0; str[i] != '\0'; i++) {
int seqlen;
@@ -70,5 +70,5 @@ int encode_devnode_name(const char *str, char *str_enc, size_t len) {
str_enc[j] = '\0';
return 0;
err:
- return -1;
+ return -EINVAL;
}