- if (handle==-1){
- error_code=yaffs_get_error();
- //printf("EEXIST def %d, Error code %d\n",(- EEXIST),error_code);
- if (abs(error_code)== EINVAL){
- return 1;
- }
- else {
- printf("different error than expected\n");
- return -1;
- }
- }
- else {
- printf(" file opened with bad mode.(which is a bad thing)\n");
+
+ /* yaffs_open does not check the modes passed into it. This means that the file should open */
+ if (handle < 0){
+ print_message("file not opened with bad creation mode set (which is a bad thing)\n",2);