From: Timothy Manning Date: Fri, 15 Oct 2010 02:40:53 +0000 (+1300) Subject: yaffs Add error retrieval function for yaffs direct testing X-Git-Tag: linux-mainline-rc-01~8^2~8 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=679f371f44c58b815b42f3390a81c269f5bb9710 yaffs Add error retrieval function for yaffs direct testing Allows yaffs direct errors to be read in python. Signed-off-by: Timothy Manning --- diff --git a/direct/python/yaffsfs.py b/direct/python/yaffsfs.py index 986f358..7347687 100644 --- a/direct/python/yaffsfs.py +++ b/direct/python/yaffsfs.py @@ -255,6 +255,11 @@ yaffs_get_trace=ylib.yaffs_get_trace yaffs_get_trace.argtypes=[] yaffs_get_trace.restypes=c_uint +#int yaffs_get_error(void) +yaffs_get_error=ylib.yaffs_get_error +yaffs_get_error.argtypes=[] +yaffs_get_error.restypes=c_int + yaffs_O_CREAT=ylib.yaffs_O_CREAT() yaffs_O_RDONLY=ylib.yaffs_O_RDONLY() yaffs_O_WRONLY=ylib.yaffs_O_WRONLY() diff --git a/direct/yaffsfs.c b/direct/yaffsfs.c index 2294888..83605c5 100644 --- a/direct/yaffsfs.c +++ b/direct/yaffsfs.c @@ -2326,6 +2326,11 @@ int yaffs_n_handles(const YCHAR *path) return yaffsfs_CountHandles(obj); } +int yaffs_get_error(void) +{ + return yaffsfs_GetLastError(); +} + int yaffs_DumpDevStruct(const YCHAR *path) { #if 0 diff --git a/direct/yaffsfs.h b/direct/yaffsfs.h index 36b7e5a..6dd2c94 100644 --- a/direct/yaffsfs.h +++ b/direct/yaffsfs.h @@ -171,11 +171,14 @@ void yaffs_AddDevice(struct yaffs_DeviceStruct *dev); int yaffs_StartUp(void); +/* Function to get the last error */ +int yaffs_get_error(void); /* Function only for debugging */ void * yaffs_getdev(const YCHAR *path); int yaffs_DumpDevStruct(const YCHAR *path); + #endif