public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Anthony G. Basile" <blueness@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/elfix:master commit in: misc/install.wrapper.c/
Date: Sat, 18 Jan 2014 20:30:55 +0000 (UTC)	[thread overview]
Message-ID: <1390077036.c8259e3db52ff45c9346d8ae01e3d7e3285678f0.blueness@gentoo> (raw)

commit:     c8259e3db52ff45c9346d8ae01e3d7e3285678f0
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 18 20:29:47 2014 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Jan 18 20:30:36 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=c8259e3d

misc/install.wrapper.c: add xstrdup() helper

---
 misc/install.wrapper.c/install.wrapper.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/misc/install.wrapper.c/install.wrapper.c b/misc/install.wrapper.c/install.wrapper.c
index 4925e32..bad64fe 100644
--- a/misc/install.wrapper.c/install.wrapper.c
+++ b/misc/install.wrapper.c/install.wrapper.c
@@ -20,6 +20,15 @@
 #include <sys/stat.h>
 #include <sys/xattr.h>
 
+static char *
+xstrdup(const char *s)
+{
+	char *ret = strdup(s);
+	if (ret == NULL)
+		err(1, "strdup() failed");
+	return ret;
+}
+
 static void *
 xmalloc(size_t size)
 {
@@ -137,7 +146,7 @@ which(const char *mydir)
 		path = xmalloc(len);
 		confstr(_CS_PATH, path, len);
 	} else
-		path = strdup(env_path);
+		path = xstrdup(env_path);
 
 	char *dir;       /* one directory in the $PATH string */
 	char *candir;    /* canonical value of that directory */
@@ -207,9 +216,9 @@ main(int argc, char* argv[])
 
 	portage_xattr_exclude = getenv("PORTAGE_XATTR_EXCLUDE");
 	if (portage_xattr_exclude == NULL)
-		exclude = strdup("security.* system.nfs4_acl");
+		exclude = xstrdup("security.* system.nfs4_acl");
 	else
-		exclude = strdup(portage_xattr_exclude);
+		exclude = xstrdup(portage_xattr_exclude);
 
 	len_exclude = strlen(exclude);
 


             reply	other threads:[~2014-01-18 20:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-18 20:30 Anthony G. Basile [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-02-07 18:10 [gentoo-commits] proj/elfix:master commit in: misc/install.wrapper.c/ Anthony G. Basile
2014-02-07 18:10 Anthony G. Basile
2014-01-20 19:02 Anthony G. Basile
2014-01-18 23:39 Anthony G. Basile
2014-01-18 23:25 Anthony G. Basile
2014-01-18 20:57 Anthony G. Basile
2014-01-18 20:23 Anthony G. Basile
2014-01-18 20:06 Anthony G. Basile
2014-01-18 13:18 Anthony G. Basile
2014-01-18 13:18 Anthony G. Basile

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=1390077036.c8259e3db52ff45c9346d8ae01e3d7e3285678f0.blueness@gentoo \
    --to=blueness@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.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