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=f7f33bb44ae72c4bfd9783c49765c4dae83ce0c6;hb=3c4743e938878986b5fd89119d1d050658b8024e;hpb=947a6c107a40f43b64adb3736a495e47caad7414 diff --git a/src/basic/errno-list.c b/src/basic/errno-list.c index f7f33bb44..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,16 +19,14 @@ #include -#include "config.h" -#include "util.h" #include "errno-list.h" +#include "macro.h" static const struct errno_name* lookup_errno(register const char *str, register GPERF_LEN_TYPE len); - -#include "errno-to-name.h" #include "errno-from-name.h" +#include "errno-to-name.h" const char *errno_to_name(int id) { @@ -50,13 +46,13 @@ 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; } -/// UNNEEDED by elogind -#if 0 +#if 0 /// UNNEEDED by elogind int errno_max(void) { return ELEMENTSOF(errno_names); }