#include "test_yaffs_lseek_EINVAL.h"
-int handle=0;
+int handle=-1;
int test_yaffs_lseek_EINVAL(void){
handle=test_yaffs_open();
int error_code=0;
- int output=yaffs_lseek(handle, 0, -1);
+ int output=0;
+
+ if (handle<0){
+ printf("failed to open file\n");
+ return -1;
+ }
+
+
+ output=yaffs_lseek(handle, 0, -1);
if (output<0){
error_code=yaffs_get_error();