[PATCH 2/2] posix_fallocate() *returns* error codes but does not set errno

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Nov 2 15:06:00 GMT 2017


Hi Erik,

On Nov  2 15:15, Erik M. Bray wrote:
> diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
> index f46e355..9d5ec30 100644
> --- a/winsup/cygwin/fhandler_disk_file.cc
> +++ b/winsup/cygwin/fhandler_disk_file.cc
> @@ -1116,11 +1116,11 @@ fhandler_disk_file::ftruncate (off_t length, bool allow_truncate)
>    int res = -1;

Shouldn't this initialization to -1 go away then?  Or set to 0 and...

> @@ -1160,7 +1159,7 @@ fhandler_disk_file::ftruncate (off_t length, bool allow_truncate)
>  				     &feofi, sizeof feofi,
>  				     FileEndOfFileInformation);
>        if (!NT_SUCCESS (status))
> -	__seterrno_from_nt_status (status);
> +	res = geterrno_from_nt_status (status);
>        else
>  	res = 0;

...this else branch go away like you did in posix_fallocate?


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20171102/59358e2c/attachment.sig>


More information about the Cygwin-patches mailing list