- if (output<0){
- error_code=yaffs_get_error();
- //printf("EISDIR def %d, Error code %d\n", ENOTDIR,error_code);
- if (abs(error_code)==EINVAL){
+ if (handle < 0){
+ print_message("failed to open file\n", 2);
+ return -1;
+ }
+
+ output = yaffs_lseek(handle, 0, -1);
+
+ if (output < 0){
+ error_code = yaffs_get_error();
+ if (abs(error_code) == EINVAL){