From: Darren Tucker Date: Mon, 9 Feb 2026 18:34:46 +0000 (+1100) Subject: Provide compat shims for sys/{mount.h,statvfs.h). X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e9c4ed3b0e5d3890fcd2cbc9c3b595f17ea1946;p=thirdparty%2Fopenssh-portable.git Provide compat shims for sys/{mount.h,statvfs.h). In addition to shimming on platforms that don't have them, we also need to shim sys/mount.h on DragonFlyBSD since it uses its native STAILQ_ENTRYs which our compat queues.h does not have, which causes sftp-server.o to not build. This is a little icky, but it limits the blast radius to just one source file on only DragonFly. ok djm@ --- diff --git a/configure.ac b/configure.ac index c6245305d..42dffd154 100644 --- a/configure.ac +++ b/configure.ac @@ -536,7 +536,9 @@ AC_CHECK_HEADERS([ \ poll.h \ stdint.h \ sys/mman.h \ + sys/mount.h \ sys/stat.h \ + sys/statvfs.h \ sys/time.h \ sys/un.h \ time.h \ @@ -569,6 +571,16 @@ for include in sys/queue.h sys/tree.h; do esac >"$header" done +# DragonFly uses STAILQ_* in its sys/mount.h, so we explicitly +# need to include the system one first, not our shim. +case "$host" in +*-*-dragonfly*) + mkdir -p openbsd-compat/include/sys + echo '#include "/usr/include/sys/queue.h"' + echo '#include "/usr/include/sys/mount.h"' + ;; +esac > "openbsd-compat/include/sys/mount.h" + AC_CHECK_DECLS([le32toh, le64toh, htole64], [], [], [ #ifdef HAVE_SYS_TYPES_H # include diff --git a/sftp-client.c b/sftp-client.c index d8b364581..164ab4072 100644 --- a/sftp-client.c +++ b/sftp-client.c @@ -24,11 +24,9 @@ #include #include -#ifdef HAVE_SYS_STATVFS_H -#include -#endif #include #include +#include #include #include diff --git a/sftp-server.c b/sftp-server.c index 2f725d265..feb2ad8ac 100644 --- a/sftp-server.c +++ b/sftp-server.c @@ -21,12 +21,8 @@ #include #include #include -#ifdef HAVE_SYS_MOUNT_H #include -#endif -#ifdef HAVE_SYS_STATVFS_H #include -#endif #include #include diff --git a/sftp.c b/sftp.c index f2be1fe38..b4d2c802d 100644 --- a/sftp.c +++ b/sftp.c @@ -21,10 +21,8 @@ #include #include #include -#include -#ifdef HAVE_SYS_STATVFS_H #include -#endif +#include #include #include