Closed Bug 354305 Opened 18 years ago Closed 18 years ago

[PATCH] FreeBSD 6.2 support in nspr: getprotobyname_r available

Categories

(NSPR :: NSPR, defect, P2)

x86
FreeBSD
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: flameeyes, Assigned: wtc)

Details

Attachments

(1 file, 1 obsolete file)

User-Agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.4 (like Gecko) Build Identifier: The attached patch allows to build nspr on FreeBSD 6.2. Support for getprotobyname_r() function is added since 6.2-BETA1, with the same 5-args form of GLIBC 2. Reproducible: Always
Attached patch nspr-4.6.3-fbsd62.patch (obsolete) — Splinter Review
Comment on attachment 240132 [details] [diff] [review] nspr-4.6.3-fbsd62.patch r=wtc. Thank you for the patch. Does NSPR not compile if this patch is not applied? Another place to define these two macros is _freebsd.h. See http://lxr.mozilla.org/nspr/source/nsprpub/pr/include/md/_freebsd.h and http://lxr.mozilla.org/nspr/source/nsprpub/pr/include/md/_netbsd.h Question -- in _freebsd.h we are including <osreldate.h> to get the definition of the __FreeBSD_version macro. Is that still the right header to include, or is <sys/param.h> better?
Attachment #240132 - Flags: review+
At least 4.6.3 release does not build without this patch (fails with a conflicting declaration of getprotobyname_r and getprotobynumber_r: ../../../dist/include/nspr/md/_freebsd.h:101:1: warning: "_PR_INET6" redefined <command line>:1:1: warning: this is the location of the previous definition ../../../../mozilla/nsprpub/pr/src/misc/prnetdb.c:1183: error: conflicting types for 'getprotobyname_r' /usr/include/netdb.h:249: error: previous declaration of 'getprotobyname_r' was here ../../../../mozilla/nsprpub/pr/src/misc/prnetdb.c:1192: error: conflicting types for 'getprotobynumber_r' /usr/include/netdb.h:252: error: previous declaration of 'getprotobynumber_r' was here gmake[3]: *** [prnetdb.o] Error 1 gmake[3]: Leaving directory `/var/tmp/portage/nspr-4.6.3/work/nspr-4.6.3/build/pr/src/misc' gmake[2]: *** [export] Error 2 gmake[2]: Leaving directory `/var/tmp/portage/nspr-4.6.3/work/nspr-4.6.3/build/pr/src' gmake[1]: *** [export] Error 2 gmake[1]: Leaving directory `/var/tmp/portage/nspr-4.6.3/work/nspr-4.6.3/build/pr' gmake: *** [export] Error 2 the two functions have been added to FreeBSD 6.2 and were not available before. osreldate.h is as good as sys/param.h to include, so I suppose that the whole inclusion part can be simply dropped; I'll attach an updated patch after making sure that it actually builds. I've defined _PR_HAVE_GETPROTO_R in prnetdb.c itself mostly because all the other operating systems have their defines there.
This version relies on osreldate.h being included already by _freebsd.h, so just checks the __FreeBSD_version (an undefined macro will evaluate to 0). I haven't moved the definition around as the rest of the checks are local to this file.
Attachment #240132 - Attachment is obsolete: true
Comment on attachment 240163 [details] [diff] [review] Updated (smaller) patch r=wtc.
Attachment #240163 - Flags: review+
I checked in the patch on the NSPR trunk (NSPR 4.7) and the NSPRPUB_PRE_4_2_CLIENT_BRANCH (Mozilla trunk/1.9 alpha). Checking in prnetdb.c; /cvsroot/mozilla/nsprpub/pr/src/misc/prnetdb.c,v <-- prnetdb.c new revision: 3.51; previous revision: 3.50 done Checking in prnetdb.c; /cvsroot/mozilla/nsprpub/pr/src/misc/prnetdb.c,v <-- prnetdb.c new revision: 3.21.2.29; previous revision: 3.21.2.28 done
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
OS: Other → FreeBSD
Priority: -- → P2
Target Milestone: --- → 4.6.4
I checked in the patch on the NSPR_4_6_BRANCH (NSPR 4.6.4). Checking in prnetdb.c; /cvsroot/mozilla/nsprpub/pr/src/misc/prnetdb.c,v <-- prnetdb.c new revision: 3.47.2.1; previous revision: 3.47 done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: