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