From c0d2f3874207e870ffb8a181b0a49637d77e5fdc Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 2 Dec 2023 14:38:28 +0100 Subject: Cygwin: fallocate(2): drop useless zeroing pointer The out pointer is only used if data_chunk_count is > 0, so there's no reason to set it to NULL in the error case. Signed-off-by: Corinna Vinschen --- winsup/cygwin/fhandler/disk_file.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'winsup') diff --git a/winsup/cygwin/fhandler/disk_file.cc b/winsup/cygwin/fhandler/disk_file.cc index ce15e41a4..d08fe9160 100644 --- a/winsup/cygwin/fhandler/disk_file.cc +++ b/winsup/cygwin/fhandler/disk_file.cc @@ -1319,9 +1319,7 @@ fhandler_disk_file::falloc_zero_range (int mode, off_t offset, off_t length) status = NtFsControlFile (get_handle (), NULL, NULL, NULL, &io, FSCTL_QUERY_ALLOCATED_RANGES, &inp, sizeof inp, out, 2 * NT_MAX_PATH); - if (NT_ERROR (status)) - out = NULL; - else + if (!NT_ERROR (status)) data_chunk_count = io.Information / sizeof *out; } -- cgit v1.2.3