From: Erik Faye-Lund <kusmabite@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH/RFC 1/2] wrapper: supply xsetenv
Date: Tue, 13 Dec 2011 13:10:26 +0100 [thread overview]
Message-ID: <1323778227-1664-1-git-send-email-kusmabite@gmail.com> (raw)
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
---
git-compat-util.h | 1 +
wrapper.c | 6 ++++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index 77062ed..551a0be 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -439,6 +439,7 @@ extern int xdup(int fd);
extern FILE *xfdopen(int fd, const char *mode);
extern int xmkstemp(char *template);
extern int xmkstemp_mode(char *template, int mode);
+extern int xsetenv(const char *name, const char *val, int override);
extern int odb_mkstemp(char *template, size_t limit, const char *pattern);
extern int odb_pack_keep(char *name, size_t namesz, unsigned char *sha1);
diff --git a/wrapper.c b/wrapper.c
index 85f09df..442800b 100644
--- a/wrapper.c
+++ b/wrapper.c
@@ -381,3 +381,9 @@ int remove_or_warn(unsigned int mode, const char *file)
{
return S_ISGITLINK(mode) ? rmdir_or_warn(file) : unlink_or_warn(file);
}
+
+int xsetenv(const char *name, const char *val, int overwrite)
+{
+ if (setenv(name, val, overwrite))
+ die_errno("setenv failed");
+}
--
1.7.7.1.msysgit.0.272.g9e47e
next reply other threads:[~2011-12-13 12:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-13 12:10 Erik Faye-Lund [this message]
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 ` [PATCH/RFC 1/2] wrapper: supply xsetenv Jeff King
2011-12-13 18:34 ` 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=1323778227-1664-1-git-send-email-kusmabite@gmail.com \
--to=kusmabite@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).