1 #include "test_yaffs_open_EEXIST.h"
4 int test_yaffs_open_EEXIST(void){
7 /*printf("path %s\n",path); */
8 handle=yaffs_open(FILE_PATH, O_CREAT | O_EXCL | O_TRUNC| O_RDWR ,FILE_MODE );
10 error_code=yaffs_get_error();
11 printf("EEXIST def %d, Error code %d\n",(- EEXIST),error_code);
12 if (abs(error_code)== EEXIST){
16 printf("different error than expected\n");
21 printf("non existant file opened.(which is a bad thing)\n");
24 /* the program should not get here but the compiler is complaining */
27 int test_yaffs_open_EEXIST_clean(void){
29 return yaffs_close(handle);
32 return 1; /* the file failed to open so there is no need to close it*/