Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Oct 2001 22:57:26 -0600 (MDT)
From:      Heath Nielson <heath@cs.byu.edu>
To:        Warner Losh <imp@harmony.village.org>
Cc:        David Marker <marker_d@yahoo.com>, <freebsd-stable@FreeBSD.ORG>
Subject:   Re: setenv() cores with NULL value [was Re: Gdm proplem on 4.4] 
Message-ID:  <Pine.LNX.4.33.0110152249220.8479-100000@organ.cs.byu.edu>
In-Reply-To: <200110160353.f9G3rO728525@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 15 Oct 2001, Warner Losh wrote:

> In message <Pine.LNX.4.33.0110151727300.6035-100000@organ.cs.byu.edu> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.33.0110152249220.8479-100000>