[PATCH 2 of 2] Core: remove NGX_TIME_T_SIZE

Maxim Dounin mdounin at mdounin.ru
Fri Jul 8 01:12:32 UTC 2016


Hello!

On Mon, Jun 27, 2016 at 06:30:03PM -0700, Piotr Sikora wrote:

> # HG changeset patch
> # User Piotr Sikora <piotrsikora at google.com>
> # Date 1467064810 25200
> #      Mon Jun 27 15:00:10 2016 -0700
> # Node ID a2892701d91e6aba62719b54792e1e14eeea11a0
> # Parent  1059f59c44039020843ced5bca39f165c322bacb
> Core: remove NGX_TIME_T_SIZE.
> 
> Replace ./configure-time test with equivalent compile-time test.
> 
> Signed-off-by: Piotr Sikora <piotrsikora at google.com>
> 
> diff -r 1059f59c4403 -r a2892701d91e auto/unix
> --- a/auto/unix
> +++ b/auto/unix
> @@ -624,7 +624,6 @@ ngx_param=NGX_MAX_OFF_T_VALUE; ngx_value
>  ngx_param=NGX_OFF_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
>  
>  ngx_type="time_t"; . auto/types/sizeof
> -ngx_param=NGX_TIME_T_SIZE; ngx_value=$ngx_size; . auto/types/value
>  ngx_param=NGX_TIME_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
>  ngx_param=NGX_MAX_TIME_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
>  
> diff -r 1059f59c4403 -r a2892701d91e src/core/ngx_module.h
> --- a/src/core/ngx_module.h
> +++ b/src/core/ngx_module.h
> @@ -18,9 +18,7 @@
>  #define NGX_MODULE_UNSET_INDEX  (ngx_uint_t) -1
>  
>  
> -#define NGX_MODULE_SIGNATURE_0                                                \
> -    ngx_value(NGX_PTR_SIZE) ","                                               \
> -    ngx_value(NGX_TIME_T_SIZE) ","
> +#define NGX_MODULE_SIGNATURE_0   ngx_value(NGX_PTR_SIZE) ","
>  
>  #if (NGX_HAVE_KQUEUE)
>  #define NGX_MODULE_SIGNATURE_1   "1"

I don't think that size of time_t should be removed from module 
signatures.  E.g., OpenBSD switched to 64-bit time_t on 32-bit 
hosts a couple of years ago, and I would expect similar things to 
happen on other platforms as well.  Signatures were designed to 
prevent loading of incompatible modules in such cases.

It can be replaced with, e.g., NGX_TIME_T_LEN, but I don't see 
reasoning behind these changes.  Are you trying to make it 
possible to build nginx as a multiarchitecture binary?

[...]

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx-devel mailing list