yaffs: Update year to 2011 in copyrights etc.
[yaffs2.git] / direct / timothy_tests / quick_tests / test_yaffs_fstat.c
index 73451611c162ce4bc80650bc6d852f8cfa47b575..c19ddea89f6ce8f642c974e6f24678451d1563b3 100644 (file)
@@ -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 <timothy@yaffs.net>
 
 #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;