postgresql/src/tools/ifaddrs
Michael Paquier 2c8118ee5d Use printf's %m format instead of strerror(errno) in more places
Most callers of strerror() are removed from the backend code.  The
remaining callers require special handling with a saved errno from a
previous system call.  The frontend code still needs strerror() where
error states need to be handled outside of fprintf.

Note that pg_regress is not changed to use %m as the TAP output may
clobber errno, since those functions call fprintf() and friends before
evaluating the format string.

Support for %m in src/port/snprintf.c has been added in d6c55de1f9,
hence all the stable branches currently supported include it.

Author: Dagfinn Ilmari Mannsåker
Discussion: https://postgr.es/m/87sf13jhuw.fsf@wibble.ilmari.org
2024-03-12 10:02:54 +09:00
..
.gitignore Clean up test_ifaddrs a bit. 2017-03-07 12:06:07 -05:00
Makefile Update copyright for 2024 2024-01-03 20:49:05 -05:00
README Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
test_ifaddrs.c Use printf's %m format instead of strerror(errno) in more places 2024-03-12 10:02:54 +09:00

README

src/tools/ifaddrs/README

test_ifaddrs
============

This program prints the addresses and netmasks of all the IPv4 and IPv6
interfaces on the local machine.  It is useful for testing that this
functionality works on various platforms.  If "samehost" and "samenet"
in pg_hba.conf don't seem to work right, run this program to see what
is happening.

Usage:	test_ifaddrs