public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jeff King <peff@peff•net>
To: Erik Faye-Lund <kusmabite@gmail•com>
Cc: git@vger•kernel.org
Subject: Re: [PATCH/RFC 1/2] wrapper: supply xsetenv
Date: Tue, 13 Dec 2011 13:16:02 -0500	[thread overview]
Message-ID: <20111213181602.GB1663@sigill.intra.peff.net> (raw)
In-Reply-To: <1323778227-1664-1-git-send-email-kusmabite@gmail.com>

On Tue, Dec 13, 2011 at 01:10:26PM +0100, Erik Faye-Lund wrote:

> +int xsetenv(const char *name, const char *val, int overwrite)
> +{
> +	if (setenv(name, val, overwrite))
> +		die_errno("setenv failed");
> +}

It probably doesn't matter, because the error condition is almost
certainly just "oops, we ran out of memory". But you could also print
the name of the variable being set, which may give the user a clue to
some misconfiguration (e.g., trying to put some extremely long value
into the environment).

-Peff

  parent reply	other threads:[~2011-12-13 18:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-13 12:10 [PATCH/RFC 1/2] wrapper: supply xsetenv Erik Faye-Lund
2011-12-13 12:10 ` [PATCH/RFC 2/2] change all unchecked calls to setenv to xsetenv Erik Faye-Lund
2011-12-13 18:19   ` Jeff King
2011-12-13 18:33     ` Junio C Hamano
2011-12-13 18:55       ` Erik Faye-Lund
2011-12-13 18:16 ` Jeff King [this message]
2011-12-13 18:34   ` [PATCH/RFC 1/2] wrapper: supply xsetenv Junio C Hamano
2011-12-13 18:52     ` Erik Faye-Lund
2011-12-13 19:21       ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111213181602.GB1663@sigill.intra.peff.net \
    --to=peff@peff$(echo .)net \
    --cc=git@vger$(echo .)kernel.org \
    --cc=kusmabite@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox