]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: Avoid compiler warning for unused label
authorJo Sutton <josutton@catalyst.net.nz>
Mon, 1 Jul 2024 03:55:13 +0000 (15:55 +1200)
committerMartin Schwenke <martins@samba.org>
Tue, 2 Jul 2024 04:44:56 +0000 (04:44 +0000)
If either of HAVE_FSTATFS and HAVE_LINUX_MAGIC_H are not defined, gcc
produces the following error:

../../source3/smbd/open.c: In function ‘reopen_from_fsp’:
../../source3/smbd/open.c:1222:1: error: label ‘namebased_open’ defined but not used [-Werror=unused-label]
 1222 | namebased_open:
      | ^~~~~~~~~~~~~~

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Jul  2 04:44:56 UTC 2024 on atb-devel-224

source3/smbd/open.c

index 3b1e9700db3163f0e1fe5b53f7408714ec7dd917..0c101c19b4693fc79fff51606db82ed1215afc94 100644 (file)
@@ -1219,7 +1219,9 @@ static NTSTATUS reopen_from_fsp(struct files_struct *dirfsp,
                return NT_STATUS_OK;
        }
 
+#if defined(HAVE_FSTATFS) && defined(HAVE_LINUX_MAGIC_H)
 namebased_open:
+#endif
        /*
         * Close the existing pathref fd and set the fsp flag
         * is_pathref to false so we get a "normal" fd this time.