From 679f371f44c58b815b42f3390a81c269f5bb9710 Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Fri, 15 Oct 2010 15:40:53 +1300 Subject: [PATCH] yaffs Add error retrieval function for yaffs direct testing Allows yaffs direct errors to be read in python. Signed-off-by: Timothy Manning --- direct/python/yaffsfs.py | 5 +++++ direct/yaffsfs.c | 5 +++++ direct/yaffsfs.h | 3 +++ 3 files changed, 13 insertions(+) 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 -- 2.30.2