} else {
printf("error\n yaffs failed to mount: %s\n with error code %d\n",YAFFS_MOUNT_POINT, yaffs_get_error());
- return (0);
+ return (-1);
}
//now create a file.
output = yaffs_open(FILE_PATH,O_CREAT | O_RDWR, S_IREAD | S_IWRITE);
printf("yaffs correctly created a the file: %s\n",FILE_PATH);
} else {
printf("error\n yaffs failed to create the file: %s\nerror\n",FILE_PATH);
- return (0);
+ return (-1);
}
output2 = yaffs_close(output);
if (output2>=0){
printf("yaffs correctly closed the file: %s\n",FILE_PATH);
} else {
printf("error\n yaffs failed to close the file: %s\nerror\n",FILE_PATH);
- return (0);
+ return (-1);
}
//unmount and remount the mount point.
output = yaffs_unmount(YAFFS_MOUNT_POINT);
printf("yaffs correctly unmounted: %s\n",YAFFS_MOUNT_POINT);
} else {
printf("error\n yaffs failed to unmount: %s\nerror\n",YAFFS_MOUNT_POINT);
- return (0);
+ return (-1);
}
output = yaffs_mount(YAFFS_MOUNT_POINT);
if (output>=0){
printf("yaffs correctly mounted: %s\n",YAFFS_MOUNT_POINT);
} else {
printf("error\n yaffs failed to mount: %s\nerror\n",YAFFS_MOUNT_POINT);
- return (0);
+ return (-1);
}
//now open the existing file.
output = yaffs_open(FILE_PATH, O_RDWR, S_IREAD | S_IWRITE);
printf("yaffs correctly opened the file: %s\n",FILE_PATH);
} else {
printf("error\n yaffs failed to create the file: %s\nerror\n",FILE_PATH);
- return (0);
+ return (-1);
}
//close the file.
output2 = yaffs_close(output);
printf("yaffs correctly closed the file: %s\n",FILE_PATH);
} else {
printf("error\n yaffs failed to close the file: %s\nerror\n",FILE_PATH);
- return (0);
+ return (-1);
}
//unmount the mount point.
printf("yaffs correctly unmounted: %s\n",YAFFS_MOUNT_POINT);
} else {
printf("error\n yaffs failed to unmount: %s\nerror\n",YAFFS_MOUNT_POINT);
- return (0);
+ return (-1);
}
printf("test passed. yay!\n");
+ return(0);
}