]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib/replace: let DISABLE_OPATH also undef __NR_openat2
authorStefan Metzmacher <metze@samba.org>
Fri, 12 Aug 2022 08:53:06 +0000 (10:53 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 15 Aug 2022 15:03:37 +0000 (15:03 +0000)
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>
lib/replace/replace.c

index 54d3a60e179d09d0432022473f0d02973567bc1b..cbf372e494f17e655b7d364722dd5d7ced387e84 100644 (file)
@@ -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)
 {