projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of ssh://www.aleph1.co.uk/home/aleph1/git/yaffs2
[yaffs2.git]
/
direct
/
python
/
yaffs_error_converter.c
diff --git
a/direct/python/yaffs_error_converter.c
b/direct/python/yaffs_error_converter.c
index 5d9247a43a063753a310304a1eebdf94b6e666ee..0d1601f75923f05a3133b8aff8d7647d46fcf430 100644
(file)
--- a/
direct/python/yaffs_error_converter.c
+++ b/
direct/python/yaffs_error_converter.c
@@
-13,12
+13,12
@@
#include "yaffs_error_converter.h"
#include "yaffs_error_converter.h"
-
typedef struct error_codes_template
{
+
struct error_entry
{
int code;
char * text;
int code;
char * text;
-}
error_entry
;
+};
-
cons
t error_entry error_list[] = {
+
static const struc
t error_entry error_list[] = {
{ ENOMEM , "ENOMEM" },
{ EBUSY , "EBUSY"},
{ ENODEV , "ENODEV"},
{ ENOMEM , "ENOMEM" },
{ EBUSY , "EBUSY"},
{ ENODEV , "ENODEV"},
@@
-36,14
+36,19
@@
const error_entry error_list[] = {
{ EEXIST , "EEXIST"},
{ ENOTDIR , "ENOTDIR"},
{ EISDIR , "EISDIR"},
{ EEXIST , "EEXIST"},
{ ENOTDIR , "ENOTDIR"},
{ EISDIR , "EISDIR"},
+ { ENFILE, "ENFILE"},
+ { EROFS, "EROFS"},
+ { ELOOP, "ELOOP"},
{ 0, NULL }
};
const char * yaffs_error_to_str(int err)
{
{ 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;
if (err < 0)
err = -err;
+
while(e->code && e->text){
if(err == e->code)
return e->text;
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";
}
}
return "Unknown error code";
}
-