From: | Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> |
---|---|
To: | tgl(at)sss(dot)pgh(dot)pa(dot)us |
Cc: | a(dot)zakirov(at)postgrespro(dot)ru, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: pg_upgrade: exit_hook_registered variable |
Date: | 2016-07-29 00:10:36 |
Message-ID: | 20160729.091036.173486062.horiguchi.kyotaro@lab.ntt.co.jp |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
At Thu, 28 Jul 2016 10:58:24 -0400, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote in <4782(dot)1469717904(at)sss(dot)pgh(dot)pa(dot)us>
> Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> writes:
> >> I noticed that exit_hook_registered variable in start_postmaster() is
> >> local variable. Shouldn't it be a static variable?
>
> > Good catch! It is totally useless unless being static.
>
> Indeed.
>
> > But I think it is not necessary to go outside
> > start_postmaster. Just being static staying in start_postmaster
> > is enough.
>
> I agree, since there's no need for any other function to touch it.
> But personally I'd want to visually separate the static variable
> from the non-static ones. So maybe like this:
It looks better indeed.
> {
> char cmd[MAXPGPATH * 4 + 1000];
> PGconn *conn;
> - bool exit_hook_registered = false;
> bool pg_ctl_return = false;
> char socket_string[MAXPGPATH + 200];
> +
> + static bool exit_hook_registered = false;
>
> if (!exit_hook_registered)
> {
>
>
> Will push it in a bit.
Thanks.
--
Kyotaro Horiguchi
NTT Open Source Software Center
From | Date | Subject | |
---|---|---|---|
Next Message | Josh Berkus | 2016-07-29 01:07:23 | Re: Why we lost Uber as a user |
Previous Message | Andres Freund | 2016-07-28 23:29:02 | Re: old_snapshot_threshold allows heap:toast disagreement |