chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
list: LIST_INSERT_BEFORE: update head if necessary (#4261)
[elogind.git]
/
src
/
basic
/
errno-list.c
diff --git
a/src/basic/errno-list.c
b/src/basic/errno-list.c
index 5b7ac65ba6c1972ed02b66c3dec966c7de3be849..c568629f7ba64cde19ae1e795ebb09a3795c8fd6 100644
(file)
--- 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.
/***
This file is part of systemd.
@@
-21,14
+19,12
@@
#include <string.h>
#include <string.h>
-#include "config.h"
#include "errno-list.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);
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"
#include "errno-from-name.h"
#include "errno-to-name.h"
@@
-50,13
+46,13
@@
int errno_from_name(const char *name) {
sc = lookup_errno(name, strlen(name));
if (!sc)
sc = lookup_errno(name, strlen(name));
if (!sc)
- return
0
;
+ return
-EINVAL
;
+ assert(sc->id > 0);
return sc->id;
}
return sc->id;
}
-/// UNNEEDED by elogind
-#if 0
+#if 0 /// UNNEEDED by elogind
int errno_max(void) {
return ELEMENTSOF(errno_names);
}
int errno_max(void) {
return ELEMENTSOF(errno_names);
}