summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2022-08-12 10:53:06 +0200
committerStefan Metzmacher <metze@samba.org>2022-08-16 18:27:13 +0000
commitb71871a193d38e8f3e9e4da426b11ed402f4438b (patch)
tree4c72aec0b4c20edb9a366b293c704c8a84f21cca /lib
parent4b1f56aa04a3e0a1ffbfda7f596d7a5762813a56 (diff)
downloadsamba-b71871a193d38e8f3e9e4da426b11ed402f4438b.tar.gz
lib/replace: let DISABLE_OPATH also undef __NR_openat2
The reason for DISABLE_OPATH is to simulate a non-linux system, so we should not use openat2() either. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146 (cherry picked from commit ae1a84f7313bdf4702492451714eacc78ee7745f)
Diffstat (limited to 'lib')
-rw-r--r--lib/replace/replace.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/replace/replace.c b/lib/replace/replace.c
index 54d3a60e179..cbf372e494f 100644
--- a/lib/replace/replace.c
+++ b/lib/replace/replace.c
@@ -1104,6 +1104,14 @@ ssize_t rep_copy_file_range(int fd_in,
# endif /* defined(LINUX) && defined(HAVE_SYS_SYSCALL_H) */
#endif /* !__NR_openat2 */
+#ifdef DISABLE_OPATH
+/*
+ * systems without O_PATH also don't have openat2,
+ * so make sure we at a realistic combination.
+ */
+#undef __NR_openat2
+#endif /* DISABLE_OPATH */
+
long rep_openat2(int dirfd, const char *pathname,
struct open_how *how, size_t size)
{