Still more #ifdef fun: struct sockaddr_storage - Mailing list pgsql-hackers

From Tom Lane
Subject Still more #ifdef fun: struct sockaddr_storage
Date
Msg-id 16940.1152980523@sss.pgh.pa.us
Whole thread Raw
List pgsql-hackers
pgcheckdefines reports

src/port/getaddrinfo.c references HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN, defined in src/include/libpq/pqcomm.h

I think this is an actual bug: if we have a platform that calls its
struct sockaddr_storage member __ss_len, and we are using our own
getaddrinfo code, we will fail to initialize the length member of
the returned ai_addr struct.

It would be safe to include src/include/libpq/pqcomm.h into
getaddrinfo.c, but it seems a tad ugly.  Perhaps the machinations
in pqcomm.h to normalize the sockaddr_storage names ought to be
moved into a separate header file?  If so, where to put it?
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Florian G. Pflug"
Date:
Subject: RFC: A dead simple implementation of pg_rotate_wal
Next
From: "Sergey E. Koposov"
Date:
Subject: PG_RETURN_INT64 vs PointerGetDatum & ANALYZE