From owner-freebsd-ports@FreeBSD.ORG Sun Nov 19 20:28:19 2006 Return-Path: X-Original-To: ports@freebsd.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 492C816A51C for ; Sun, 19 Nov 2006 20:28:19 +0000 (UTC) (envelope-from venture37@hotmail.com) Received: from bay0-omc1-s16.bay0.hotmail.com (bay0-omc1-s16.bay0.hotmail.com [65.54.246.88]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7B29B43D98 for ; Sun, 19 Nov 2006 20:24:13 +0000 (GMT) (envelope-from venture37@hotmail.com) Received: from hotmail.com ([207.46.8.27]) by bay0-omc1-s16.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Sun, 19 Nov 2006 12:24:17 -0800 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sun, 19 Nov 2006 12:24:17 -0800 Message-ID: Received: from 217.22.88.123 by BAY117-DAV17.phx.gbl with DAV; Sun, 19 Nov 2006 20:24:14 +0000 X-Originating-IP: [217.22.88.123] X-Originating-Email: [venture37@hotmail.com] X-Sender: venture37@hotmail.com Message-ID: <4560BEA2.3070809@hotmail.com> Date: Sun, 19 Nov 2006 20:29:22 +0000 From: Sevan / Venture37 User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: ports@freebsd.org X-Enigmail-Version: 0.94.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 19 Nov 2006 20:24:17.0128 (UTC) FILETIME=[AFC8F680:01C70C18] Cc: Subject: Dealing with clearenv() X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Nov 2006 20:28:19 -0000 Chillispot 1.1 uses clearenv() which is not available in FreeBSD. What's the best way for dealing with this, atm I'm using the following patch to the source code which seems to work & none of the testers have reported back with any problems. Is there a better way to deal with the issue?? +#ifdef HAVE_CLEARENV if (clearenv() != 0) { sys_err(LOG_ERR, __FILE__, __LINE__, errno, "clearenv() did not return 0!"); exit(0); } +#else + extern char **environ; + environ[0] = NULL; + if (environ[0] != NULL) { + sys_err(LOG_ERR, __FILE__, __LINE__, errno, + "Venture37 doesn't know what he's doing!!!"); + exit(0); + } +#endif Sevan / Venture37 -- "The truth, the half-truth, and nothing like the truth." - Mark Brandon Read