pgsql: Fix unportable usage of printf("%m"). - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix unportable usage of printf("%m").
Date
Msg-id E1fKWTZ-0000ri-Jo@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix unportable usage of printf("%m").

While glibc's version of printf accepts %m, most others do not;
to be portable, we have to do it the hard way with strerror(errno).
pg_verify_checksums evidently did not get that memo.

Noted while fooling around with NetBSD-current, which generates
a compiler warning for this mistake.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a13b47a59ffce6f3c13c8b777738a3aab1db10d3

Modified Files
--------------
src/bin/pg_verify_checksums/pg_verify_checksums.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: printf("%lf") is not portable, so omit the "l".
Next
From: Tom Lane
Date:
Subject: pgsql: Fix unsafe usage of strerror(errno) within ereport().