yaffs commiting changes to timothy_tests
[yaffs2.git] / direct / timothy_tests / error_handler.c
index b41f7327df12c956060238ac26a069286d9ab7dd..90b3fade0134003c009c431726464fe9d1821ffc 100644 (file)
@@ -1,19 +1,34 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
+ *
+ * Copyright (C) 2002-2010 Aleph One Ltd.
+ *   for Toby Churchill Ltd and Brightstar Engineering
+ *
+ * Created by Timothy Manning <timothy@yaffs.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * error_handler.c contains code for checking yaffs function calls for errors.
+ */
 #include "error_handler.h"
 
 void yaffs_check_for_errors(char output, buffer *message_buffer,char error_message[],char success_message[])
 {
+       char dummy='0';
        if (output==-1)
        {
-               add_to_buffer(message_buffer, "error##########",MESSAGE_LEVEL_ERROR);
-               add_to_buffer(message_buffer, error_message,MESSAGE_LEVEL_ERROR);
-               add_to_buffer(message_buffer, "error_code",MESSAGE_LEVEL_ERROR);
-               if (MESSAGE_LEVEL_ERROR<=DEBUG_LEVEL)   printf("%d\n",yaffs_get_error());       /*cannot yet add int types to buffer. this is a quick fix*/             
-
+               add_to_buffer(message_buffer, "\nerror##########",MESSAGE_LEVEL_ERROR,PRINT);
+               add_to_buffer(message_buffer, error_message,MESSAGE_LEVEL_ERROR,PRINT);
+               add_to_buffer(message_buffer, "error_code: ",MESSAGE_LEVEL_ERROR,PRINT);
+               if (MESSAGE_LEVEL_ERROR<=DEBUG_LEVEL)   printf("%d\n\n\n",yaffs_get_error());   /*cannot yet add int types to buffer. this is a quick fix*/             
+               scanf("%c",dummy);
                //print_buffer(message_buffer,PRINT_ALL);
-       
+               
        }
        else{
-               add_to_buffer(message_buffer, success_message,MESSAGE_LEVEL_BASIC_TASKS);
+               add_to_buffer(message_buffer, success_message,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
        }
                
 }