X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fbasic%2Ferrno-list.c;h=c568629f7ba64cde19ae1e795ebb09a3795c8fd6;hp=c41a8b8847c3309e319a445391befe33aac64a01;hb=3c4743e938878986b5fd89119d1d050658b8024e;hpb=c5729796b4ec5e5f4800bfe6bd9ceb5c2da81fbe diff --git a/src/basic/errno-list.c b/src/basic/errno-list.c index c41a8b884..c568629f7 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,12 @@ #include -#include "config.h" #include "errno-list.h" -#include "util.h" +#include "macro.h" static const struct errno_name* lookup_errno(register const char *str, register GPERF_LEN_TYPE len); - #include "errno-from-name.h" #include "errno-to-name.h" @@ -50,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; }