diff --git a/src/bin/pg_ctl/pg_ctl.cpp b/src/bin/pg_ctl/pg_ctl.cpp index ce4be48c9..97438f554 100755 --- a/src/bin/pg_ctl/pg_ctl.cpp +++ b/src/bin/pg_ctl/pg_ctl.cpp @@ -1905,12 +1905,11 @@ static void do_stop(bool force) print_msg(_("waiting for server to shut down...")); for (cnt = 0; cnt < wait_seconds; cnt++) { - if (((pid = get_pgpid()) != 0) || - (postmaster_is_alive((pid_t)tpid) && IsMyPostmasterPid((pid_t)tpid, pg_config))) { - print_msg("."); - pg_usleep(1000000); /* 1 sec */ - } else + if (!(postmaster_is_alive((pid_t)tpid) && IsMyPostmasterPid((pid_t)tpid, pg_config))) break; + + print_msg("."); + pg_usleep(1000000); } if ((pid = get_pgpid()) != 0) { /* pid file still exists */