Welcome! Log In Create A New Profile

Advanced

[nginx] Win32: fixed unique file index calculations.

Sergey Kandaurov
March 27, 2024 01:48PM
details: https://hg.nginx.org/nginx/rev/000e2ded0a51
branches:
changeset: 9229:000e2ded0a51
user: Piotr Sikora <piotr@aviatrix.com>
date: Mon Feb 26 20:00:35 2024 +0000
description:
Win32: fixed unique file index calculations.

The old code was breaking strict aliasing rules.

Signed-off-by: Piotr Sikora <piotr@aviatrix.com>

diffstat:

src/os/win32/ngx_files.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r dd4a570ff4ac -r 000e2ded0a51 src/os/win32/ngx_files.h
--- a/src/os/win32/ngx_files.h Mon Feb 26 20:00:28 2024 +0000
+++ b/src/os/win32/ngx_files.h Mon Feb 26 20:00:35 2024 +0000
@@ -154,7 +154,8 @@ ngx_int_t ngx_file_info(u_char *filename
(((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 */
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Win32: fixed unique file index calculations.

Sergey Kandaurov 125 March 27, 2024 01:48PM



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

Online Users

Guests: 173
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