Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p9uFe-0001Gh-0r for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Dec 2022 20:39:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p9uFb-0001Lb-FJ for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Dec 2022 20:39:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p9uFb-0001LQ-21 for pgsql-hackers@lists.postgresql.org; Mon, 26 Dec 2022 20:39:11 +0000 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p9uFY-0005AS-0T for pgsql-hackers@postgresql.org; Mon, 26 Dec 2022 20:39:10 +0000 Received: by mail-il1-x12c.google.com with SMTP id o13so5924007ilc.7 for ; Mon, 26 Dec 2022 12:39:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=HEcMVzFrecVPP5AEw+/yxE2Ze/K9XeAtaUIpNWpSeXc=; b=zgAWpgoQ5EpXwSU3argQsB/DJ4P4tyUx+S+dhecuYzQJMe5ptPhvMVT2egeYCH8GhN 5159/FGtMczBJhNcWBDcsxaT7g00fGALGUXG5ItxN65l7ItV3wclCHvdmuCDQ5Jkevgx CST1Iha1tJX/wyLLkM830SYDsVpBo00BreLsyEw0itI3NrlVBMeQsb7YxA6nql/uA1MQ LZrTe6soVHkNv+UdJKiEpLwBZ5368Q6OKephKZmrp6yOZw6624guHRrbirO/fZkx4wvX klRn69m5gkcthHTx9L1gRDQe34O8FD3xsZL0B8mQgOgVRaDYMBLW8lapRJQuHG9GzHb2 it/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HEcMVzFrecVPP5AEw+/yxE2Ze/K9XeAtaUIpNWpSeXc=; b=tUveQl/+RGnGz0hzK7HTiMtC7pE4BQa6YcU5ZhMx9QVMbfg6CVcp8gB3rHZkjV8br7 OxAb/mAGk5YoGhseSyYvC2eZMxm83/gNUKTcA7q4zZ7V1+KH8wy0BXNtIN4fjUZgQJxT vdFfrCKMSNmAZ65ToHj3JIEFDKAEZEwa3QTX4D7hykP+yrWxZS5fx2q5ZM6iXsonAyrz vQuJ7DbGN93OYhVyJHhEiBdL+VaxgfhUXZUouIKWIMFecOdK2qFl4SpgXHJw/46X4fve mgxnluv+qMnNWcurhNP2oC4QxgE4z1d4NLParrHrLLMCxQQVBsLzWR2nKO/J0nVg5tlK XCvw== X-Gm-Message-State: AFqh2kpkejXyQzXcG221hG/AlXbsaQsOSCp7TYpzjPYhoRBMB6hCYP9V RnGfmFpcEJRWP71ca3ho8TdWsw== X-Google-Smtp-Source: AMrXdXtqPWNoPfOxy8d8q14Z7Snsq+ZkB7dbXiDl7Z98gf9pMjVJNoW85HNYF92XZBpWmVzDPmRbIw== X-Received: by 2002:a92:d2c4:0:b0:303:410a:f2b3 with SMTP id w4-20020a92d2c4000000b00303410af2b3mr12319832ilg.13.1672087145900; Mon, 26 Dec 2022 12:39:05 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id z3-20020a029383000000b00389d81b2f67sm3690592jah.160.2022.12.26.12.39.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Dec 2022 12:39:05 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 1760E800C0F; Mon, 26 Dec 2022 14:39:04 -0600 (CST) Date: Mon, 26 Dec 2022 14:39:03 -0600 From: Justin Pryzby To: Michael Paquier Cc: Bharath Rupireddy , David Christensen , Ian Lawrence Barwick , Matthias van de Meent , pgsql-hackers@postgresql.org Subject: Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL Message-ID: <20221226203903.GT1153@telsasoft.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Dec 26, 2022 at 04:28:52PM +0900, Michael Paquier wrote: > Comments? > + file = fopen(filename, PG_BINARY_W); > + if (!file) > + pg_fatal("could not open file \"%s\": %m", filename); > + > + if (fwrite(page, BLCKSZ, 1, file) != 1) > + pg_fatal("could not write file \"%s\": %m", filename); > + > + fclose(file); fclose() should be tested, too: > + if (fwrite(page, BLCKSZ, 1, file) != 1 || fclose(file) != 0) > + pg_fatal("could not write file \"%s\": %m", filename); -- Justin