File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -38,16 +38,13 @@ register_wait_collector(void)
3838 BackgroundWorker worker ;
3939
4040 /* Set up background worker parameters */
41+ memset (& worker , 0 , sizeof (worker ));
4142 worker .bgw_flags = BGWORKER_SHMEM_ACCESS ;
4243 worker .bgw_start_time = BgWorkerStart_ConsistentState ;
4344 worker .bgw_restart_time = 0 ;
4445 worker .bgw_notify_pid = 0 ;
45- #if PG_VERSION_NUM >= 100000 || defined(WIN32 )
46- memcpy (worker .bgw_library_name , "pg_wait_sampling" , BGW_MAXLEN );
47- memcpy (worker .bgw_function_name , CppAsString (collector_main ), BGW_MAXLEN );
48- #else
49- worker .bgw_main = collector_main ;
50- #endif
46+ snprintf (worker .bgw_library_name , BGW_MAXLEN , "pg_wait_sampling" );
47+ snprintf (worker .bgw_function_name , BGW_MAXLEN , CppAsString (collector_main ));
5148 snprintf (worker .bgw_name , BGW_MAXLEN , "pg_wait_sampling collector" );
5249 worker .bgw_main_arg = (Datum ) 0 ;
5350 RegisterBackgroundWorker (& worker );
You can’t perform that action at this time.
0 commit comments