X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Ftimothy_tests%2Ferror_handler.c;h=3474d0168bee73a428cad8466993e6558dc56466;hp=f060cafa3002b01dd81d3a2bfb338a94ce222f28;hb=a34826e701dd381a293bb90b25a48d2bd58e8de8;hpb=941b43d04d6684b006fbe648f150192116f11ab1 diff --git a/direct/timothy_tests/error_handler.c b/direct/timothy_tests/error_handler.c index f060caf..3474d01 100644 --- a/direct/timothy_tests/error_handler.c +++ b/direct/timothy_tests/error_handler.c @@ -1,19 +1,36 @@ +/* + * 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); - printf("%d\n",yaffs_get_error()); - + 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); } }