vfs_gpfs: fix bogus compiler warning
authorRalph Boehme <slow@samba.org>
Tue, 20 Oct 2020 19:59:35 +0000 (21:59 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:31 +0000 (09:08 +0000)
The next commit adds the first call inside Samba to the VFS function
SMB_VFS_FGET_DOS_ATTRIBUTES() and therefor also to
vfs_gpfs_fget_dos_attributes().  No idea why gcc is generating this warning:

[4127/4716] Compiling source3/modules/vfs_aio_fork.c
../../source3/modules/vfs_gpfs.c: In function ‘vfs_gpfs_fget_dos_attributes’:
../../source3/modules/vfs_gpfs.c:1728:2: error: ‘file_id’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
 1728 |  update_stat_ex_file_id(&fsp->fsp_name->st, file_id);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors

This change fixes the error.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_gpfs.c

index 4a8418aa726c7368e92c2a010fa1950d31db217b..ae5e2638115625e887c743a76f22eacc31ab64c0 100644 (file)
@@ -1819,6 +1819,7 @@ static NTSTATUS vfs_gpfs_fget_dos_attributes(struct vfs_handle_struct *handle,
                return map_nt_error_from_unix(errno);
        }
 
+       ZERO_STRUCT(file_id);
        status = vfs_gpfs_get_file_id(&iattr, &file_id);
        if (!NT_STATUS_IS_OK(status)) {
                return status;