projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
yaffs More tests added to direct/timothy_tests/quick_tests/
[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 1fd7b213cb1be760e6ad6efb3fe45cb9bb8cc89e..1701c5e772ab98cd6ca824c817cfe6b5c8e5949e 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"},
@@
-43,9
+43,11
@@
const error_entry error_list[] = {
const char * yaffs_error_to_str(int err)
{
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;
@@
-53,4
+55,3
@@
const char * yaffs_error_to_str(int err)
}
return "Unknown error code";
}
}
return "Unknown error code";
}
-