X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Ftimothy_tests%2Fquick_tests%2Ftest_yaffs_fstat.c;h=dfdc80d65ae3a43f288185b0e144b3e1c654be6a;hp=73451611c162ce4bc80650bc6d852f8cfa47b575;hb=a32621e0d7f5f391e9152cfe710fa6c99ca44c50;hpb=4adb62b1e4338eaa34d02fdcb0c5d99cebea6747 diff --git a/direct/timothy_tests/quick_tests/test_yaffs_fstat.c b/direct/timothy_tests/quick_tests/test_yaffs_fstat.c index 7345161..dfdc80d 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_fstat.c +++ b/direct/timothy_tests/quick_tests/test_yaffs_fstat.c @@ -13,21 +13,23 @@ #include "test_yaffs_fstat.h" -static int handle=0; -int test_yaffs_fstat(void){ +static int handle = -1; +int test_yaffs_fstat(void) +{ struct yaffs_stat stat; - handle=test_yaffs_open(); - if (handle>=0){ - return yaffs_fstat(handle , &stat);; - } - else { - printf("error opening file\n"); + handle = test_yaffs_open(); + + if (handle >= 0){ + return yaffs_fstat(handle , &stat); + } else { + print_message( "error opening file\n", 2 ); return -1; } } -int test_yaffs_fstat_clean(void){ - if (handle<0){ +int test_yaffs_fstat_clean(void) +{ + if (handle <= 0){ return yaffs_close(handle); } return 1;