]> git.kaiwu.me - nginx.git/commitdiff
Fixed NGX_TID_T_FMT format specification for uint64_t.
authorMaxim Dounin <mdounin@mdounin.ru>
Sun, 22 Jul 2018 01:03:40 +0000 (04:03 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Sun, 22 Jul 2018 01:03:40 +0000 (04:03 +0300)
Previously, "%uA" was used, which corresponds to ngx_atomic_uint_t.
Size of ngx_atomic_uint_t can be easily different from uint64_t,
leading to undefined results.

src/os/unix/ngx_thread.h

index 1b52dd7fbe5dcb8d6b18e3dfaeeb84de6bb6c11a..e3b5e813414c94293825aa38a4c2831c9e01e496 100644 (file)
@@ -47,12 +47,12 @@ typedef uint32_t   ngx_tid_t;
 #elif (NGX_DARWIN)
 
 typedef uint64_t   ngx_tid_t;
-#define NGX_TID_T_FMT         "%uA"
+#define NGX_TID_T_FMT         "%uL"
 
 #else
 
 typedef uint64_t   ngx_tid_t;
-#define NGX_TID_T_FMT         "%uA"
+#define NGX_TID_T_FMT         "%uL"
 
 #endif