From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id C748E385AC09; Mon, 4 Dec 2023 09:21:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C748E385AC09 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1701681711; bh=pvpQ18Bduu7TvhcWPhe0k9kQVDyk64LY+lgBzEN9IHo=; h=From:To:Subject:Date:From; b=kQqLB09z7TPB/7Lh5OpD+VJFOxiDS8Vnpd7yh821tPuMMKbP3uy89q99kXU+p5Tjb UROcBHcWSOyegLZN7aH1IuTGbGYYVe48BDs/xuzft+kY+wsWqjxBvKhYztZgaimURV tXs/JHLsWb8gLsKiefBXI9G4AW9WtrdPK7tfSI2w= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/main] Cygwin: fallocate(2): drop useless zeroing pointer X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/main X-Git-Oldrev: 97b1f4db067cc98a0e059c3a4952a1f1f64d984e X-Git-Newrev: c0d2f3874207e870ffb8a181b0a49637d77e5fdc Message-Id: <20231204092151.C748E385AC09@sourceware.org> Date: Mon, 4 Dec 2023 09:21:51 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dc0d2f387420= 7e870ffb8a181b0a49637d77e5fdc commit c0d2f3874207e870ffb8a181b0a49637d77e5fdc Author: Corinna Vinschen AuthorDate: Sat Dec 2 14:38:28 2023 +0100 Commit: Corinna Vinschen CommitDate: Mon Dec 4 10:20:55 2023 +0100 Cygwin: fallocate(2): drop useless zeroing pointer =20 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. =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/fhandler/disk_file.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/winsup/cygwin/fhandler/disk_file.cc b/winsup/cygwin/fhandler/d= isk_file.cc index ce15e41a4e77..d08fe9160d35 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 =3D NtFsControlFile (get_handle (), NULL, NULL, NULL, &io, FSCTL_QUERY_ALLOCATED_RANGES, &inp, sizeof inp, out, 2 * NT_MAX_PATH); - if (NT_ERROR (status)) - out =3D NULL; - else + if (!NT_ERROR (status)) data_chunk_count =3D io.Information / sizeof *out; }