test_yaffs_close_EBADF.o\
test_yaffs_chmod.o test_yaffs_chmod_ENOENT.o test_yaffs_chmod_ENOTDIR.o test_yaffs_chmod_EINVAL.o \
test_yaffs_chmod_ENOENT2.o test_yaffs_chmod_ELOOP_dir.o test_yaffs_chmod_ELOOP.o test_yaffs_chmod_EROFS.o \
- test_yaffs_fchmod.o test_yaffs_fchmod_EBADF.o\
+ test_yaffs_fchmod.o test_yaffs_fchmod_EBADF.o test_yaffs_fchmod_EROFS.o test_yaffs_fchmod_EINVAL.o\
test_yaffs_fsync.o test_yaffs_fsync_EBADF.o \
test_yaffs_fdatasync.o test_yaffs_fdatasync_EBADF.o \
test_yaffs_mkdir.o test_yaffs_mkdir_EEXIST.o test_yaffs_mkdir_ENOTDIR.o test_yaffs_mkdir_ENOENT.o \
#include "test_yaffs_fchmod.h"
#include "test_yaffs_fchmod_EBADF.h"
#include "test_yaffs_fchmod_EINVAL.h"
+#include "test_yaffs_fchmod_EROFS.h"
#include "test_yaffs_fsync.h"
#include "test_yaffs_fsync_EBADF.h"
{test_yaffs_fchmod,test_yaffs_fchmod_clean,"test_yaffs_fchmod"},
{test_yaffs_fchmod_EBADF,test_yaffs_fchmod_EBADF_clean,"test_yaffs_fchmod_EBADF"},
{test_yaffs_fchmod_EINVAL,test_yaffs_fchmod_EINVAL_clean,"test_yaffs_fchmod_EINVAL"},
+ {test_yaffs_fchmod_EROFS,test_yaffs_fchmod_EROFS_clean,"test_yaffs_fchmod_EROFS"},
{test_yaffs_fsync,test_yaffs_fsync_clean,"test_yaffs_fsync"},
{test_yaffs_fsync_EBADF,test_yaffs_fsync_EBADF_clean,"test_yaffs_fsync_EBADF"},
--- /dev/null
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
+ *
+ * Copyright (C) 2002-2010 Aleph One Ltd.
+ * for Toby Churchill Ltd and Brightstar Engineering
+ *
+ * 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_fchmod_EROFS.h"
+static int handle = -1;
+
+int test_yaffs_fchmod_EROFS(void)
+{
+ int error = 0;
+ int output = 0;
+ if (EROFS_setup() < 0 ){
+ return -1;
+ }
+ handle = test_yaffs_open();
+
+ if (handle < 0){
+ print_message("failed to open file\n",2);
+ return -1;
+ }
+
+ output = yaffs_fchmod(handle,S_IREAD|S_IWRITE);
+
+ if (output<0){
+ error=yaffs_get_error();
+ if (abs(error)==EROFS){
+ return 1;
+ } else {
+ print_message("different error than expected\n",2);
+ return -1;
+ }
+ } else {
+ print_message("chmoded with EROFS (which is a bad thing)\n",2);
+ return -1;
+ }
+
+
+}
+
+int test_yaffs_fchmod_EROFS_clean(void)
+{
+ int output =-1;
+ if (handle >= 0) {
+ output= yaffs_close(handle);
+ }
+ return (EROFS_clean() && output);
+}
--- /dev/null
+/*
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
+ *
+ * Copyright (C) 2002-2010 Aleph One Ltd.
+ * for Toby Churchill Ltd and Brightstar Engineering
+ *
+ * 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_fchmod_EROFS_h__
+#define __test_yaffs_fchmod_EROFS_h__
+
+#include "lib.h"
+#include "yaffsfs.h"
+
+int test_yaffs_fchmod_EROFS(void);
+int test_yaffs_fchmod_EROFS_clean(void);
+
+#endif