summaryrefslogtreecommitdiff
path: root/lib/shell.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-01-05 01:58:08 +0100
committerRichard Braun <rbraun@sceen.net>2018-01-05 01:58:26 +0100
commit62d27d872769ebcd79a931fa07b1128576e65e65 (patch)
tree0a99e87809c9055dcdcfbd9ed4bec1a72534ced9 /lib/shell.h
parenta6c056ce150bd0339d5325edc18717b2d02a5b8d (diff)
error: remove and use standard errno codes instead
This change also adds strerror to string.h.
Diffstat (limited to 'lib/shell.h')
-rw-r--r--lib/shell.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/shell.h b/lib/shell.h
index f66fbf7..b5ce7d5 100644
--- a/lib/shell.h
+++ b/lib/shell.h
@@ -29,11 +29,13 @@
#ifndef _SHELL_H
#define _SHELL_H
+#include <errno.h>
#include <stddef.h>
+#include <string.h>
#include <lib/macros.h>
-#include <src/error.h>
+#include <src/panic.h>
#define SHELL_REGISTER_CMDS(cmds) \
MACRO_BEGIN \
@@ -42,7 +44,10 @@ MACRO_BEGIN \
\
for (___i = 0; ___i < ARRAY_SIZE(cmds); ___i++) { \
___error = shell_cmd_register(&(cmds)[___i]); \
- error_check(___error, __func__); \
+ \
+ if (___error) { \
+ panic("%s: %s", __func__, strerror(___error)); \
+ } \
} \
MACRO_END