X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=direct%2Ftimothy_tests%2Ferror_handler.c;h=90b3fade0134003c009c431726464fe9d1821ffc;hb=1006cb30d2977365c64e4dd544b445b088750061;hp=b41f7327df12c956060238ac26a069286d9ab7dd;hpb=b708f76c6a03f86058236dbd529e8c3623571325;p=yaffs2.git diff --git a/direct/timothy_tests/error_handler.c b/direct/timothy_tests/error_handler.c index b41f732..90b3fad 100644 --- a/direct/timothy_tests/error_handler.c +++ b/direct/timothy_tests/error_handler.c @@ -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 + * + * 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); } }