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=c19ddea89f6ce8f642c974e6f24678451d1563b3;hp=73451611c162ce4bc80650bc6d852f8cfa47b575;hb=6648cbf52d6695755941ff8607fd7a0cda542e05;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..c19ddea 100644 --- a/direct/timothy_tests/quick_tests/test_yaffs_fstat.c +++ b/direct/timothy_tests/quick_tests/test_yaffs_fstat.c @@ -1,7 +1,7 @@ /* * YAFFS: Yet another FFS. A NAND-flash specific file system. * - * Copyright (C) 2002-2010 Aleph One Ltd. + * Copyright (C) 2002-2011 Aleph One Ltd. * for Toby Churchill Ltd and Brightstar Engineering * * Created by Timothy Manning @@ -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;