git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 7fa945b) | patch
Clean up messy API for src/port/thread.c.
2022年1月11日 18:46:12 +0000 (13:46 -0500)
2022年1月11日 18:46:20 +0000 (13:46 -0500)
commit 98e93a1fc93e9b54eb477d870ec744e9e1669f34
Clean up messy API for src/port/thread.c.

The point of this patch is to reduce inclusion spam by not needing
to #include <netdb.h> or <pwd.h> in port.h (which is read by every
compile in our tree). To do that, we must remove port.h's
declarations of pqGetpwuid and pqGethostbyname.

pqGethostbyname is only used, and is only ever likely to be used,
in src/port/getaddrinfo.c --- which isn't even built on most
platforms, making pqGethostbyname dead code for most people.
Hence, deal with that by just moving it into getaddrinfo.c.

To clean up pqGetpwuid, invent a couple of simple wrapper
functions with less-messy APIs. This allows removing some
duplicate error-handling code, too.

In passing, remove thread.c from the MSVC build, since it
contains nothing we use on Windows.

Noted while working on 376ce3e40.

Discussion: https://postgr.es/m/1634252654444.90107@mit.edu
src/backend/libpq/auth.c diff | blob | blame | history
src/bin/psql/common.c diff | blob | blame | history
src/include/port.h diff | blob | blame | history
src/interfaces/libpq/fe-auth.c diff | blob | blame | history
src/interfaces/libpq/fe-auth.h diff | blob | blame | history
src/interfaces/libpq/fe-connect.c diff | blob | blame | history
src/port/Makefile diff | blob | blame | history
src/port/getaddrinfo.c diff | blob | blame | history
src/port/path.c diff | blob | blame | history
src/port/thread.c diff | blob | blame | history
src/tools/msvc/Mkvcbuild.pm diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /