+int test_yaffs_ftruncate_EINVAL_clean(void)
+{
+ /* change file size back to orignal size */
+ int output = 0;
+ if (handle >= 0){
+ output = yaffs_ftruncate(handle,FILE_SIZE );
+ if (output >= 0){
+ return yaffs_close(handle);
+ } else {
+ print_message("failed to truncate file\n", 2);
+ return -1;
+ }
+ } else {
+ /* the file was not opened so the file could not be truncated */
+ return 1;
+ }