From owner-p4-projects@FreeBSD.ORG Sun Jan 20 02:44:38 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9321016A41A; Sun, 20 Jan 2008 02:44:38 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4096F16A418 for ; Sun, 20 Jan 2008 02:44:38 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 26DE513C442 for ; Sun, 20 Jan 2008 02:44:38 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m0K2icSV030007 for ; Sun, 20 Jan 2008 02:44:38 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m0K2icJX030003 for perforce@freebsd.org; Sun, 20 Jan 2008 02:44:38 GMT (envelope-from jb@freebsd.org) Date: Sun, 20 Jan 2008 02:44:38 GMT Message-Id: <200801200244.m0K2icJX030003@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 133703 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2008 02:44:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=133703 Change 133703 by jb@jb_freebsd1 on 2008/01/20 02:43:40 On FreeBSD libz is always available. I don't understand why it is optional on Solaris. We will just link it in and be done with it! Affected files ... .. //depot/projects/dtrace/src/contrib/opensolaris/lib/libctf/common/ctf_lib.c#9 edit Differences ... ==== //depot/projects/dtrace/src/contrib/opensolaris/lib/libctf/common/ctf_lib.c#9 (text) ==== @@ -34,14 +34,20 @@ #include #include #include +#if defined(sun) #include +#else +#include +#endif #include +#if defined(sun) #ifdef _LP64 static const char *_libctf_zlib = "/usr/lib/64/libz.so"; #else static const char *_libctf_zlib = "/usr/lib/libz.so"; #endif +#endif static struct { int (*z_uncompress)(uchar_t *, ulong_t *, const uchar_t *, ulong_t); @@ -60,10 +66,12 @@ void _libctf_init(void) { +#if defined(sun) const char *p = getenv("LIBCTF_DECOMPRESSOR"); if (p != NULL) _libctf_zlib = p; /* use alternate decompression library */ +#endif _libctf_debug = getenv("LIBCTF_DEBUG") != NULL; @@ -79,6 +87,7 @@ void * ctf_zopen(int *errp) { +#if defined(sun) ctf_dprintf("decompressing CTF data using %s\n", _libctf_zlib); if (zlib.z_dlp != NULL) @@ -98,6 +107,13 @@ bzero(&zlib, sizeof (zlib)); return (ctf_set_open_errno(errp, ECTF_ZINIT)); } +#else + zlib.z_uncompress = uncompress; + zlib.z_error = zError; + + /* Dummy return variable as 'no error' */ + zlib.z_dlp = (void *) (uintptr_t) 1; +#endif return (zlib.z_dlp); }