Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Nov 2006 20:29:22 +0000
From:      Sevan / Venture37 <venture37@hotmail.com>
To:        ports@freebsd.org
Subject:   Dealing with clearenv()
Message-ID:  <4560BEA2.3070809@hotmail.com>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4560BEA2.3070809>