summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-06-06 08:13:51 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-06-06 08:15:51 +0200
commit09dd936307c6530d7fd99b6bfbc197a98b6bc5e3 (patch)
tree9176093f79dbd6a120f85345276862049fcf8376
parent572f667e069b1bd468eba2a704e364b810f40b78 (diff)
rtems_yaffs: RTEMS API changes (chmod)
-rw-r--r--rtems/rtems_yaffs.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/rtems/rtems_yaffs.c b/rtems/rtems_yaffs.c
index 3bea242..c93eeaa 100644
--- a/rtems/rtems_yaffs.c
+++ b/rtems/rtems_yaffs.c
@@ -431,27 +431,20 @@ static int ryfs_fstat(const rtems_filesystem_location_info_t *loc, struct stat *
static int ryfs_fchmod(const rtems_filesystem_location_info_t *loc, mode_t mode)
{
int rv = 0;
- mode_t mode_mask = S_IRWXU | S_IRWXG | S_IRWXO;
-
- if ((mode & ~mode_mask) == 0) {
- struct yaffs_obj *obj = ryfs_get_object_by_location(loc);
- int yc;
-
- obj = yaffs_get_equivalent_obj(obj);
- if (obj != NULL) {
- obj->yst_mode = (obj->yst_mode & ~mode_mask) | mode;
- obj->dirty = 1;
- yc = yaffs_flush_file(obj, 0, 0);
- } else {
- yc = YAFFS_FAIL;
- }
+ struct yaffs_obj *obj = ryfs_get_object_by_location(loc);
+ int yc;
- if (yc != YAFFS_OK) {
- errno = EIO;
- rv = -1;
- }
+ obj = yaffs_get_equivalent_obj(obj);
+ if (obj != NULL) {
+ obj->yst_mode = mode;
+ obj->dirty = 1;
+ yc = yaffs_flush_file(obj, 0, 0);
} else {
- errno = EINVAL;
+ yc = YAFFS_FAIL;
+ }
+
+ if (yc != YAFFS_OK) {
+ errno = EIO;
rv = -1;
}