Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Win32: fix unique file index calculations

Sergey Kandaurov
March 27, 2024 01:52PM
> On 28 Feb 2024, at 05:25, Piotr Sikora via nginx-devel <nginx-devel@nginx.org> wrote:
>
> # HG changeset patch
> # User Piotr Sikora <piotr@aviatrix.com>
> # Date 1708977635 0
> # Mon Feb 26 20:00:35 2024 +0000
> # Branch patch012
> # Node ID 04e3155b3b9651fee708898aaf82ac35532806ee
> # Parent 9b57470dc49f8d8d10abe30a5df628732d7618dc
> Win32: fix unique file index calculations.
>
> The old code was breaking strict aliasing rules.
>
> Signed-off-by: Piotr Sikora <piotr@aviatrix.com>
>
> diff -r 9b57470dc49f -r 04e3155b3b96 src/os/win32/ngx_files.h
> --- a/src/os/win32/ngx_files.h Mon Feb 26 20:00:33 2024 +0000
> +++ b/src/os/win32/ngx_files.h Mon Feb 26 20:00:35 2024 +0000
> @@ -154,7 +154,8 @@
> (((off_t) (fi)->nFileSizeHigh << 32) | (fi)->nFileSizeLow)
> #define ngx_file_fs_size(fi) ngx_file_size(fi)
>
> -#define ngx_file_uniq(fi) (*(ngx_file_uniq_t *) &(fi)->nFileIndexHigh)
> +#define ngx_file_uniq(fi) \
> + (((ngx_file_uniq_t) (fi)->nFileIndexHigh << 32) | (fi)->nFileIndexLow)
>
>
> /* 116444736000000000 is commented in src/os/win32/ngx_time.c */

Pushed, thanks.

--
Sergey Kandaurov
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Win32: fix unique file index calculations

Piotr Sikora via nginx-devel 259 February 27, 2024 08:26PM

Re: [PATCH] Win32: fix unique file index calculations

Sergey Kandaurov 34 March 27, 2024 01:52PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 160
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready