From owner-freebsd-stable Mon Oct 15 22: 8:25 2001 Delivered-To: freebsd-stable@freebsd.org Received: from mail.cs.byu.edu (mail.cs.byu.edu [128.187.2.20]) by hub.freebsd.org (Postfix) with ESMTP id 0225A37B408 for ; Mon, 15 Oct 2001 22:08:05 -0700 (PDT) Received: from organ.cs.byu.edu (IDENT:heath@organ.cs.byu.edu [128.187.175.144]) by mail.cs.byu.edu (8.11.2/8.11.6) with ESMTP id f9G4vQ524765; Mon, 15 Oct 2001 22:57:26 -0600 Date: Mon, 15 Oct 2001 22:57:26 -0600 (MDT) From: Heath Nielson To: Warner Losh Cc: David Marker , Subject: Re: setenv() cores with NULL value [was Re: Gdm proplem on 4.4] In-Reply-To: <200110160353.f9G3rO728525@harmony.village.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 15 Oct 2001, Warner Losh wrote: > In message Heath Nielson writes: > : FreeBSD doesn't like a NULL value. There was no mention of NULL input > : values in the man page. It seems that a NULL value is valid. I can type > : export TEST= at the prompt without any errors, but I'm no shell expert. > : Maybe the TEST env. variable's value isn't really NULL. Does anyone else > : have anything to add to this? > > NULL isn't allowed to be passed to getenv. That is a programming > error. You get unpredictable results. We nicely give you a core file > so you can debug your error. > > Warner > I was actually referring to setenv(). Upon further study, I guess it boils down to a question of whether there's a difference between the two calls: setenv("TEST1", "", 1); setenv("TEST2", NULL, 1); The first call works while the second call dumps core. Both calls would seem to produce the same result as far as the environment is concerned, however this difference caused me some heartburn trying to figure out why gdm wasn't working on FreeBSD and no core was being generated (as David reported earlier in this thread). :) Heath To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message