]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: open(2): reset sparseness on O_TRUNCated files
authorCorinna Vinschen <corinna@vinschen.de>
Mon, 27 Nov 2023 20:14:49 +0000 (21:14 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Tue, 28 Nov 2023 09:55:33 +0000 (10:55 +0100)
commit7f9caa4a3698827010d9b478407d21dd58b8bca5
treed6e7d97d33bab68ccfcc9d03a4d69e63702314f7
parente01c50c7b0a6c5d2a25feb02958d57902c25c141
Cygwin: open(2): reset sparseness on O_TRUNCated files

open(2) implements O_TRUNC by just reducing the size of the file
to 0, to make sure EAs stay available.

Turns out, file sparseness is not removed this way either, so add
code to do just that.

Fixes: 603ef545bdbd ("* fhandler.cc (fhandler_base::open): Never open files with FILE_OVERWITE/FILE_OVERWRITE_IF.")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/fhandler/base.cc
winsup/cygwin/release/3.4.10
This page took 0.027763 seconds and 5 git commands to generate.