summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-10-18 12:38:58 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-10-22 08:06:05 +0200
commit1ad26cdcf7eae323feda4c1030c057c52126af3b (patch)
tree1470970a2ab7faa010077e88f06b4b72d89d5f7e /cpukit/libcsupport
parentSupport O_CLOEXEC open() flag (diff)
downloadrtems-1ad26cdcf7eae323feda4c1030c057c52126af3b.tar.bz2
Support O_NOFOLLOW open() flag
Close #3546.
Diffstat (limited to 'cpukit/libcsupport')
-rw-r--r--cpukit/libcsupport/src/open.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/cpukit/libcsupport/src/open.c b/cpukit/libcsupport/src/open.c
index 554311c5aa..86d0bbeab9 100644
--- a/cpukit/libcsupport/src/open.c
+++ b/cpukit/libcsupport/src/open.c
@@ -74,7 +74,12 @@ static int do_open(
bool exclusive = (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL);
bool truncate = (oflag & O_TRUNC) == O_TRUNC;
bool open_dir;
- int eval_flags = RTEMS_FS_FOLLOW_LINK
+#ifdef O_NOFOLLOW
+ int follow = (oflag & O_NOFOLLOW) == O_NOFOLLOW ? 0 : RTEMS_FS_FOLLOW_LINK;
+#else
+ int follow = RTEMS_FS_FOLLOW_LINK;
+#endif
+ int eval_flags = follow
| (read_access ? RTEMS_FS_PERMS_READ : 0)
| (write_access ? RTEMS_FS_PERMS_WRITE : 0)
| (make ? RTEMS_FS_MAKE : 0)