QUIC QLOG: Retrieve PID correctly on Windows

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23517)
This commit is contained in:
Hugo Landau 2024-02-08 09:55:24 +00:00
parent 1260d0f579
commit 1548e3cdaa

View File

@ -316,9 +316,12 @@ static void qlog_event_seq_header(QLOG *qlog)
ossl_json_key(&qlog->json, "process_id");
ossl_json_u64(&qlog->json, qlog->info.override_process_id);
} else {
#if defined(OPENSSL_SYS_UNIX) || defined(OPENSSL_SYS_WINDOWS)
#if defined(OPENSSL_SYS_UNIX)
ossl_json_key(&qlog->json, "process_id");
ossl_json_u64(&qlog->json, (uint64_t)getpid());
#elif defined(OPENSSL_SYS_WINDOWS)
ossl_json_key(&qlog->json, "process_id");
ossl_json_u64(&qlog->json, (uint64_t)GetCurrentProcessId());
#endif
}
} /* system_info */