Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSgdB-0007CR-Im for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Jul 2016 08:25:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bSgdB-00071r-5B for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Jul 2016 08:25:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bSgbn-0005Qk-66 for pgsql-hackers@postgresql.org; Thu, 28 Jul 2016 08:23:59 +0000 Received: from newmail.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSgbj-0007R4-Va for pgsql-hackers@postgresql.org; Thu, 28 Jul 2016 08:23:58 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id B0F4121C2718 for ; Thu, 28 Jul 2016 11:23:53 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Received: from mail.postgrespro.ru ([127.0.0.1]) by localhost (mail.postgrespro.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aXs-omibIhsj for ; Thu, 28 Jul 2016 11:23:53 +0300 (MSK) Received: from [192.168.27.153] (unknown [192.168.27.1]) by mail.postgrespro.ru (Postfix) with ESMTPSA id 8A0BE21C2709 for ; Thu, 28 Jul 2016 11:23:53 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1469694233; bh=jTRQEoX0FNUkyT7lax4VrIRiPWO9zdtiu8eG4R/qFJw=; h=To:From:Subject:Date; b=HQYFEqmRXS6T9jszjU2mbwMHkaU6XjNQ93Xub2NZcKlVi6MzQMIwWN3NAsw2/w0yj m+aVJTF6nG6q5UUERGP/OWFriR9xhvMWaRgkGTINMos72+X5DizaRDtMdTOQ7L+uyz ZjLF8xveSYVkvGUWF7MCoNL7rS9nXDH5Q8KgMggo= To: pgsql-hackers From: Artur Zakirov Subject: pg_upgrade: exit_hook_registered variable Message-ID: Date: Thu, 28 Jul 2016 11:23:42 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------248B2545EACBB0067D3252AC" X-Pg-Spam-Score: -3.3 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org This is a multi-part message in MIME format. --------------248B2545EACBB0067D3252AC Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hello hackers, I noticed that exit_hook_registered variable in start_postmaster() is local variable. Shouldn't it be a static variable? I attached a patch. Thank you! -- Artur Zakirov Postgres Professional: http://www.postgrespro.com Russian Postgres Company --------------248B2545EACBB0067D3252AC Content-Type: text/x-patch; name="pg-upgrade-atexit.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pg-upgrade-atexit.patch" diff --git a/src/bin/pg_upgrade/server.c b/src/bin/pg_upgrade/server.c index 969e5d6..a13800f 100644 --- a/src/bin/pg_upgrade/server.c +++ b/src/bin/pg_upgrade/server.c @@ -14,6 +14,8 @@ static PGconn *get_db_conn(ClusterInfo *cluster, const char *db_name); +static bool exit_hook_registered = false; + /* * connectToServer() @@ -174,7 +176,6 @@ start_postmaster(ClusterInfo *cluster, bool throw_error) { char cmd[MAXPGPATH * 4 + 1000]; PGconn *conn; - bool exit_hook_registered = false; bool pg_ctl_return = false; char socket_string[MAXPGPATH + 200]; --------------248B2545EACBB0067D3252AC Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------248B2545EACBB0067D3252AC--