summaryrefslogtreecommitdiffstats
path: root/lib/libjove/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libjove/error.c')
-rw-r--r--lib/libjove/error.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/libjove/error.c b/lib/libjove/error.c
new file mode 100644
index 0000000..4c0d043
--- /dev/null
+++ b/lib/libjove/error.c
@@ -0,0 +1,22 @@
+#include <error.h>
+#include <kernel/error.h>
+
+JoveError
+jove_error_from_kerror(int kerror)
+{
+ switch(kerror) {
+ case KE_OK:
+ return EJOVE_OK;
+ case KE_BADMSG:
+ case KE_BADOBJ:
+ return EJOVE_BADOBJ;
+ case KE_BADCALL:
+ case KE_BADFUNC:
+ return EJOVE_NOIMPL;
+ case KE_BADSIZE:
+ return EJOVE_BADSIZE;
+ case KE_DNE:
+ return EJOVE_DNE;
+ default: return EJOVE_KERROR;
+ }
+}