yaffs Added more tests to direct/timothy_tests/quick_tests
[yaffs2.git] / direct / python / yaffs_error_converter.c
index 5d9247a43a063753a310304a1eebdf94b6e666ee..0d1601f75923f05a3133b8aff8d7647d46fcf430 100644 (file)
 
 #include "yaffs_error_converter.h"
 
-typedef struct error_codes_template {
+struct error_entry {
   int code;
   char * text;  
-}error_entry;
+};
 
-const error_entry error_list[] = {
+static const struct error_entry error_list[] = {
        { ENOMEM , "ENOMEM" },
        { EBUSY , "EBUSY"},
        { ENODEV , "ENODEV"},
@@ -36,14 +36,19 @@ const error_entry error_list[] = {
        { EEXIST , "EEXIST"},
        { ENOTDIR , "ENOTDIR"},
        { EISDIR , "EISDIR"},
+       { ENFILE, "ENFILE"},
+       { EROFS, "EROFS"},
+       { ELOOP, "ELOOP"},
        { 0, NULL }
 };
 
 const char * yaffs_error_to_str(int err)
 {
-       error_entry *e = error_list;
+       const struct error_entry *e = error_list;
+
        if (err < 0) 
                err = -err;
+
        while(e->code && e->text){
                if(err == e->code)
                        return e->text;
@@ -51,4 +56,3 @@ const char * yaffs_error_to_str(int err)
        }
        return "Unknown error code";
 }
-