This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]