From ae3c419ec1b8d8068baf07030599f08a23ba0561 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 18 Jan 2023 18:01:37 +0000 Subject: [PATCH] Fix build failure on systems without fstatat. cmake's configure-time #defines (at least the way I use them) are defined to 0 or 1, rather than sometimes not defined at all, so you have to test them with plain #if rather than #ifdef or #if defined. I _thought_ I'd caught all of those in previous fixes, but apparently there were a couple still lurking. Oops. (cherry picked from commit e289265e3712a20fa03e6da2ee14a0d441056c6c) --- unix/sftpserver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/sftpserver.c b/unix/sftpserver.c index 453a3ee0..fe3c2501 100644 --- a/unix/sftpserver.c +++ b/unix/sftpserver.c @@ -602,7 +602,7 @@ static void uss_readdir(SftpServer *srv, SftpReplyBuilder *reply, char *longnamebuf = NULL; struct fxp_attrs attrs = no_attrs; -#if defined HAVE_FSTATAT && defined HAVE_DIRFD +#if HAVE_FSTATAT && HAVE_DIRFD struct stat st; if (!fstatat(dirfd(udh->dp), de->d_name, &st, AT_SYMLINK_NOFOLLOW)) { char perms[11], *uidbuf = NULL, *gidbuf = NULL;