Silence gcc warning.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Wed, 24 Apr 2024 04:43:25 +0000 (13:43 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Wed, 24 Apr 2024 04:43:25 +0000 (13:43 +0900)
Commit 0b94cd9f caused a gcc warning:
streaming_replication/pool_worker_child.c: In function 'do_worker_child':
streaming_replication/pool_worker_child.c:281:40: warning: 'watchdog_leader' may be used uninitialized in this function [-Wmaybe-uninitialized]
         if (!pool_config->use_watchdog ||
                                        ^
It seems this only occures in older gcc (e.g. gcc 4.8.5).

Backpatch-thtrough: master branch only as commit 0b94cd9f only applied to master.

src/streaming_replication/pool_worker_child.c

index a9695fb83baf8f24c30973d136e85f8991833b89..c92cf67253eaad71027e25daa217c29bbeb71685 100644 (file)
@@ -181,6 +181,7 @@ do_worker_child(void)
                /*
                 * Get watchdog status if watchdog is enabled.
                 */
+               watchdog_leader = false;
                if (pool_config->use_watchdog)
                {
                        WD_STATES       wd_status;