yaffs: Update year to 2011 in copyrights etc.
[yaffs2.git] / direct / timothy_tests / mirror_tests / lib.c
index 558de9ab0c7b932b9fa69d977dbcffc1c304492e..079ed25e9a6dfe41d60fb4b0af3e7a15cb6b42ed 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>
@@ -42,6 +42,33 @@ void display_error(void)
        
 }
 
+void get_error_yaffs(void)
+{
+       int error_code=0;
+       char message[30];
+       message[0]='\0';
+
+       error_code=yaffs_get_error();
+       sprintf(message,"yaffs_error code %d\n",error_code);
+       print_message(1,message);
+       sprintf(message,"error is : %s\n",yaffs_error_to_str(error_code));
+       print_message(1,message);
+}
+
+void get_error_linux(void)
+{
+       int error_code=0;
+       char message[30];
+       message[0]='\0';
+
+       error_code=errno;
+       sprintf(message,"linux_error code %d\n",error_code);
+       print_message(1,message);
+       strcpy(message,"error code");
+       sprintf(message,"error is : %s\n",yaffs_error_to_str(error_code));
+       //perror(message);      
+       print_message(1,message);
+}
 void  generate_random_string(char *ptr,int length_of_str){
        unsigned int x;
        unsigned int length=((rand() %(length_of_str-3))+3);    /*creates a int with the number of charecters been between 1 and 51*/