diff options
Diffstat (limited to 'src/basic/errno-list.c')
-rw-r--r-- | src/basic/errno-list.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/basic/errno-list.c b/src/basic/errno-list.c index 34d1331486..31b66bad5e 100644 --- a/src/basic/errno-list.c +++ b/src/basic/errno-list.c @@ -1,5 +1,3 @@ -/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ - /*** This file is part of systemd. @@ -21,14 +19,14 @@ #include <string.h> -#include "util.h" #include "errno-list.h" +#include "macro.h" static const struct errno_name* lookup_errno(register const char *str, - register unsigned int len); + register unsigned int len); -#include "errno-to-name.h" #include "errno-from-name.h" +#include "errno-to-name.h" const char *errno_to_name(int id) { @@ -48,8 +46,9 @@ int errno_from_name(const char *name) { sc = lookup_errno(name, strlen(name)); if (!sc) - return 0; + return -EINVAL; + assert(sc->id > 0); return sc->id; } |