Linux now allows directories to be opened.
When quick_tests were written, open was supposed to
return the error code EISDIR.
Signed-off-by: Timothy Manning <codedraftsman@gmail.com>
test_yaffs_mount.o test_yaffs_mount_ENODEV.o test_yaffs_mount_ENAMETOOLONG.o test_yaffs_mount_EBUSY.o \
test_yaffs_mount_NULL.o \
test_yaffs_unmount.o test_yaffs_unmount_ENODEV.o test_yaffs_unmount_ENAMETOOLONG.o test_yaffs_unmount_EBUSY.o \
- test_yaffs_open.o test_yaffs_open_ENOENT.o test_yaffs_open_ENOTDIR.o test_yaffs_open_EEXIST.o test_yaffs_open_EISDIR.o \
+ test_yaffs_open.o test_yaffs_open_ENOENT.o test_yaffs_open_ENOTDIR.o test_yaffs_open_EEXIST.o \
test_yaffs_open_ENAMETOOLONG.o test_yaffs_open_EINVAL.o test_yaffs_open_EINVAL2.o test_yaffs_open_ELOOP.o \
test_yaffs_open_ELOOP_dir.o test_yaffs_open_EROFS.o test_yaffs_open_EACCES.o test_yaffs_open_NULL.o \
test_yaffs_unlink.o test_yaffs_unlink_EISDIR.o test_yaffs_unlink_ENOENT.o test_yaffs_unlink_ENAMETOOLONG.o \
#include "test_yaffs_unmount_EBUSY.h"
#include "test_yaffs_open.h"
-#include "test_yaffs_open_EISDIR.h"
#include "test_yaffs_open_EEXIST.h"
#include "test_yaffs_open_ENOENT.h"
#include "test_yaffs_open_ENOTDIR.h"
{test_yaffs_unmount_EBUSY,test_yaffs_unmount_EBUSY_clean,"test_yaffs_unmount_EBUSY"},
{test_yaffs_open,test_yaffs_open_clean,"test_yaffs_open"},
- {test_yaffs_open_EISDIR,test_yaffs_open_EISDIR_clean,"test_yaffs_open_EISDIR"},
{test_yaffs_open_EEXIST,test_yaffs_open_EEXIST_clean,"test_yaffs_open_EEXIST"},
{test_yaffs_open_ENOTDIR,test_yaffs_open_ENOTDIR_clean,"test_yaffs_open_ENOTDIR"},
{test_yaffs_open_ENOENT,test_yaffs_open_ENOENT_clean,"test_yaffs_open_ENOENT"},
+++ /dev/null
-/*
- * YAFFS: Yet another FFS. A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2018 Aleph One Ltd.
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include "test_yaffs_open_EISDIR.h"
-
-/*EISDIR is caused by trying to open a directory */
-
-static int handle = -1;
-
-int test_yaffs_open_EISDIR(void)
-{
- int error_code=0;
-
- handle=yaffs_open(YAFFS_MOUNT_POINT, O_CREAT | O_TRUNC| O_RDWR ,FILE_MODE );
- if (handle == -1){
- error_code=yaffs_get_error();
- if (abs(error_code)== EISDIR){
- return 1;
- } else {
- print_message("different error than expected\n", 2);
- return -1;
- }
- } else {
- print_message("non existant directory opened.(which is a bad thing)\n", 2);
- return -1;
- }
-
-}
-int test_yaffs_open_EISDIR_clean(void)
-{
- if (handle >=0){
- return yaffs_close(handle);
- } else {
- return 1; /* the file failed to open so there is no need to close it*/
- }
-}
-
+++ /dev/null
-/*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2018 Aleph One Ltd.
- *
- * Created by Timothy Manning <timothy@yaffs.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 2.1 as
- * published by the Free Software Foundation.
- *
- * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
- */
-
-#ifndef __test_yaffs_open_EISDIR_h__
-#define __test_yaffs_open_EISDIR_h__
-
-#include "lib.h"
-#include "yaffsfs.h"
-
-int test_yaffs_open_EISDIR(void);
-int test_yaffs_open_EISDIR_clean(void);
-
-#endif