The branch main has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=7de6d9d9b6bd8b1cd5e190cf4f12df498b34a646

commit 7de6d9d9b6bd8b1cd5e190cf4f12df498b34a646
Author:     John Baldwin <j...@freebsd.org>
AuthorDate: 2025-08-08 17:43:36 +0000
Commit:     John Baldwin <j...@freebsd.org>
CommitDate: 2025-08-08 17:43:36 +0000

    openssh: Include <fcntl.h> explicitly in includes.h
    
    This was previously included due to nested includes in Heimdal's
    headers.  Without this, the build fails with an error due to redefining
    AT_FDCWD.
    
    clang:
    
    In file included from crypto/openssh/sshd-session.c:46:
    /usr/obj/.../tmp/usr/include/fcntl.h:232:9: error: 'AT_FDCWD' macro 
redefined [-Werror,-Wmacro-redefined]
      232 | #define AT_FDCWD                -100
          |         ^
    crypto/openssh/openbsd-compat/bsd-misc.h:69:10: note: previous definition 
is here
       69 | # define AT_FDCWD (-2)
          |          ^
    
    GCC (can't be disabled):
    
    In file included from crypto/openssh/sshd-session.c:46:
    sys/sys/fcntl.h:232:9: error: "AT_FDCWD" redefined [-Werror]
      232 | #define AT_FDCWD                -100
          |         ^~~~~~~~
    In file included from crypto/openssh/openbsd-compat/openbsd-compat.h:218,
                     from crypto/openssh/includes.h:173,
                     from crypto/openssh/sshd-session.c:30:
    openssh/openbsd-compat/bsd-misc.h:69:10: note: this is the location of the 
previous definition
       69 | # define AT_FDCWD (-2)
          |          ^~~~~~~~
    
    Reviewed by:    des
    Differential Revision:  https://reviews.freebsd.org/D51809
---
 crypto/openssh/includes.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/crypto/openssh/includes.h b/crypto/openssh/includes.h
index 6d17ef6da933..c3cd8b40e0b9 100644
--- a/crypto/openssh/includes.h
+++ b/crypto/openssh/includes.h
@@ -34,6 +34,9 @@
 #ifdef HAVE_ENDIAN_H
 # include <endian.h>
 #endif
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
 #ifdef HAVE_TTYENT_H
 # include <ttyent.h>
 #endif

Reply via email to