]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Code review for pg_verify_checksums.c.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 31 Aug 2018 17:42:18 +0000 (13:42 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 31 Aug 2018 17:42:29 +0000 (13:42 -0400)
commitd787af7badfe8c4c9afb7f0af9958a69b723a212
tree06b536d9f2f7186f0983c2ceac068436bfc9f2d3
parent36343e59b51165da542943d2043878737fbe910b
Code review for pg_verify_checksums.c.

Use postgres_fe.h, since this is frontend code.  Pretend that we've heard
of project style guidelines for, eg, #include order.  Use BlockNumber not
int arithmetic for block numbers, to avoid misbehavior with relations
exceeding 2^31 blocks.  Avoid an unnecessary strict-aliasing warning
(per report from Michael Banck).  Const-ify assorted stuff.  Avoid
scribbling on the output of readdir() -- perhaps that's safe in practice,
but POSIX forbids it, and this code has so far earned exactly zero
credibility portability-wise.  Editorialize on an ambiguously-worded
message.

I did not touch the problem of the "buf" local variable being possibly
insufficiently aligned; that's not specific to this code, and seems like
it should be fixed as part of a different, larger patch.

Discussion: https://postgr.es/m/1535618100.1286.3.camel@credativ.de
src/bin/pg_verify_checksums/pg_verify_checksums.c