diff options
author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2019-11-18 10:19:16 +0000 |
---|---|---|
committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2019-11-18 10:19:16 +0000 |
commit | dfe91e5e34bf866fe2231b93b1a910e159d02d64 (patch) | |
tree | b0ecab8087631c1ff11e2f47886eb3e2bc6d4ed3 /sys/compat/linux/linux_file.c | |
parent | a8c08e008a28197ebf061be1096cea97212d27dd (diff) | |
download | src-dfe91e5e34bf866fe2231b93b1a910e159d02d64.tar.gz src-dfe91e5e34bf866fe2231b93b1a910e159d02d64.zip |
Make linux(4) open(2)/openat(2) return ELOOP instead of EMLINK,
when being passed O_NOFOLLOW. This fixes LTP testcase openat02:5.
Reviewed by: emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22384
Notes
Notes:
svn path=/head/; revision=354805
Diffstat (limited to 'sys/compat/linux/linux_file.c')
-rw-r--r-- | sys/compat/linux/linux_file.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 778ad77daf98..6302a0538756 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -132,8 +132,11 @@ linux_common_open(struct thread *td, int dirfd, char *path, int l_flags, int mod /* XXX LINUX_O_NOATIME: unable to be easily implemented. */ error = kern_openat(td, dirfd, path, UIO_SYSSPACE, bsd_flags, mode); - if (error != 0) + if (error != 0) { + if (error == EMLINK) + error = ELOOP; goto done; + } if (bsd_flags & O_NOCTTY) goto done; |