The call to DNSServiceRegistrationCreate in postmaster.c does incorrect
authorNeil Conway <neilc@samurai.com>
Sat, 18 Mar 2006 22:10:11 +0000 (22:10 +0000)
committerNeil Conway <neilc@samurai.com>
Sat, 18 Mar 2006 22:10:11 +0000 (22:10 +0000)
byte-swapping on the port number which causes the call to fail on Intel
Macs.

This patch uses htons() instead of htonl() and fixes this bug.

Ashley Clark

src/backend/postmaster/postmaster.c

index 90e60b32cf69c9f10e9e2ad03213bc0173c5223d..80bba7d1522e252fc0c755f22e95e3b109dcdca8 100644 (file)
@@ -771,7 +771,7 @@ PostmasterMain(int argc, char *argv[])
                DNSServiceRegistrationCreate(bonjour_name,
                                                                         "_postgresql._tcp.",
                                                                         "",
-                                                                        htonl(PostPortNumber),
+                                                                        htons(PostPortNumber),
                                                                         "",
                                                                         (DNSServiceRegistrationReply) reg_reply,
                                                                         NULL);