1 #include "test_yaffs_open_EISDIR.h"
3 /*EISDIR is caused by trying to open a directory */
6 int test_yaffs_open_EISDIR(void){
9 /*printf("path %s\n",path); */
10 handle=yaffs_open(YAFFS_MOUNT_POINT, O_CREAT | O_TRUNC| O_RDWR ,FILE_MODE );
12 error_code=yaffs_get_error();
13 printf("EISDIR def %d, Error code %d\n", EISDIR,error_code);
14 if (abs(error_code)== EISDIR){
18 printf("different error than expected\n");
23 printf("non existant directory opened.(which is a bad thing)\n");
26 /* the program should not get here but the compiler is complaining */
29 int test_yaffs_open_EISDIR_clean(void){
31 return yaffs_close(handle);
34 return 1; /* the file failed to open so there is no need to close it*/