Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCoQf-0005AG-MW for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Nov 2017 15:07:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eCoQf-000615-66 for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Nov 2017 15:07:41 +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 1eCoQd-0005zp-Ue for pgsql-hackers@postgresql.org; Thu, 09 Nov 2017 15:07:40 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eCoQb-0002Em-M3 for pgsql-hackers@postgresql.org; Thu, 09 Nov 2017 15:07:39 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 54F1C21C1CE2 for ; Thu, 9 Nov 2017 18:07:36 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Received: from mail.postgrespro.ru (unknown [192.168.27.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 17E8721C1690 for ; Thu, 9 Nov 2017 18:07:36 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1510240056; bh=aOJCUBZVSYK2VcAq8FuXYOjWRWvV9nzAxDRHz4rDw+4=; h=Date:From:To:Subject; b=ehtnJfc56JjI62xh2E/gBPx108E0TWN/NdO7Z2Hjwz8CWsCqf1sF36YUnIZJlAlXK zgkRNSdSK32I0qoBKypwDbq6mcLD8IlxlVXNXYBCvI9hOE5BgmH8KYEtUyz4bNZ9mU 3mROviIGZaeoQ4cwzv7gDQZz+kybrJi9Jglxatec= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 09 Nov 2017 18:07:35 +0300 From: a.akenteva@postgrespro.ru To: pgsql-hackers@postgresql.org Subject: A weird bit in pg_upgrade/exec.c Message-ID: X-Sender: a.akenteva@postgrespro.ru User-Agent: Roundcube Webmail/1.2.4 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 Hello! I've came across a weird bit in pg_upgrade/exec.c We have a function check_bin_dir() which goes like this (old_cluster and new_cluster are global variables): void check_bin_dir(ClusterInfo *cluster) { ... get_bin_version(&old_cluster); get_bin_version(&new_cluster); ... } This function has two calls: check_bin_dir(&old_cluster); check_bin_dir(&new_cluster); I'd like to substitute these last two lines with this: get_bin_version(cluster); Doing it would simplify the patch I'm writing, but I'm worried I might break something that's been there for a long time and has been working fine. Is there maybe a reason for it to be this way that I don't happen to understand? Also, there's the exact same situation with the get_bin_version() function in the same file. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers