-static int handle=0;
-int test_yaffs_ftruncate_EFBIG(void){
- int output=0;
- int error_code=0;
- handle=test_yaffs_open();
- if (handle>=0){
- output=yaffs_ftruncate(handle,10000000000000000000000000000000);
- if (output<0){
- error_code=yaffs_get_error();
- //printf("EISDIR def %d, Error code %d\n", EISDIR,error_code);
- if (abs(error_code)== EINVAL){ /* yaffs uses the error EINVAL instead of EFBIG */
+static int handle = -1;
+
+int test_yaffs_ftruncate_EFBIG(void)
+{
+ int output = 0;
+ int error_code = 0;
+ handle = test_yaffs_open();
+
+ if (handle >= 0){
+ output = yaffs_ftruncate(handle,10000000000000000000000000000000);
+ if (output < 0){
+ error_code = yaffs_get_error();
+ if (abs(error_code) == EINVAL){ /* yaffs uses the error EINVAL instead of EFBIG */