Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YNkL4-00019i-No for pgsql-committers@arkaria.postgresql.org; Tue, 17 Feb 2015 15:45:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YNkL4-0004Jp-72 for pgsql-committers@arkaria.postgresql.org; Tue, 17 Feb 2015 15:45:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YNkL3-0004Jh-MS for pgsql-committers@postgresql.org; Tue, 17 Feb 2015 15:45:29 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YNkL0-0005j7-5j; Tue, 17 Feb 2015 15:45:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t1HFjODx025822; Tue, 17 Feb 2015 10:45:24 -0500 From: Tom Lane To: Robert Haas cc: pgsql-committers@postgresql.org Subject: Re: pgsql: Improve pg_check_dir code and comments. In-reply-to: References: Comments: In-reply-to Robert Haas message dated "Tue, 17 Feb 2015 15:32:26 +0000" Date: Tue, 17 Feb 2015 10:45:24 -0500 Message-ID: <25821.1424187924@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org Robert Haas writes: > Improve pg_check_dir code and comments. > Avoid losing errno if readdir() fails and closedir() works. Consistently > return 4 rather than 3 if both a lost+found directory and other files are > found, rather than returning one value or the other depending on the > order of the directory listing. Update comments to match the actual > behavior. > These oversights date to commits 6f03927fce038096f53ca67eeab9adb24938f8a6 > and 17f15239325a88581bb4f9cf91d38005f1f52d69. In that case, doesn't this need to be back-patched? In addition to the problems you cite, the previous coding appears to fail to close the directory handle if readdir() fails, which is certainly a significant enough bug to merit back-patching. regards, tom lane -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers