yaffsfs.c: Fix NULL dereference in yaffs_unmount2_reldev()
[yaffs2.git] / direct / test-framework / nandstore_file.c
index 1b9b70b9850324b29766c8eddc778788adde0e78..fa85b55df65df47bd372aefb62008c6a7075fd38 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
  *
- * Copyright (C) 2010-2011 Aleph One Ltd.
+ * Copyright (C) 2002-2018 Aleph One Ltd.
  *
  * Created by Charles Manning <charles@aleph1.co.uk>
  *
@@ -165,7 +165,7 @@ nandstore_file_init(const char *fname,
 
        strncpy(nsfp->backing_file, fname, sizeof(nsfp->backing_file));
 
-       nsfp->handle = open(nsfp->backing_file, O_RDWR | O_CREAT);
+       nsfp->handle = open(nsfp->backing_file, O_RDWR | O_CREAT, 0666);
        if(nsfp->handle >=0){
                fsize = lseek(nsfp->handle,0,SEEK_END);
                nbytes = ns->blocks * ns->pages_per_block *