From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-801275-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 52D2C138CD0
	for <garchives@archives.gentoo.org>; Tue, 19 May 2015 17:37:29 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id C3C01E09DC;
	Tue, 19 May 2015 17:37:26 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 42BADE09E2
	for <gentoo-commits@lists.gentoo.org>; Tue, 19 May 2015 17:37:26 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 059B6340BBE
	for <gentoo-commits@lists.gentoo.org>; Tue, 19 May 2015 17:37:25 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id AB8479ED
	for <gentoo-commits@lists.gentoo.org>; Tue, 19 May 2015 17:37:23 +0000 (UTC)
From: "Mike Frysinger" <vapier@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" <vapier@gentoo.org>
Message-ID: <1432050688.ee6539928328ec93f714f6426ef29edeb7f95cd4.vapier@gentoo>
Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/
X-VCS-Repository: proj/portage-utils
X-VCS-Files: libq/xasprintf.c
X-VCS-Directories: libq/
X-VCS-Committer: vapier
X-VCS-Committer-Name: Mike Frysinger
X-VCS-Revision: ee6539928328ec93f714f6426ef29edeb7f95cd4
X-VCS-Branch: master
Date: Tue, 19 May 2015 17:37:23 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 55fb7614-f298-48b6-b924-9cc4f5db908c
X-Archives-Hash: 58b950aadc5353dc0609c3bd1b3d3956

commit:     ee6539928328ec93f714f6426ef29edeb7f95cd4
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue May 19 15:51:28 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue May 19 15:51:28 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ee653992

xasprintf: support returning the len

 libq/xasprintf.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libq/xasprintf.c b/libq/xasprintf.c
index 9d8b6d5..f2f1c58 100644
--- a/libq/xasprintf.c
+++ b/libq/xasprintf.c
@@ -23,7 +23,9 @@
 
 /* asprintf(char **strp, const char *fmt, ...); */
 #define xasprintf(strp, fmt, args...) \
-	do { \
-		if (asprintf(strp, fmt , ## args) == -1) \
+	({ \
+		int _ret = asprintf(strp, fmt , ## args); \
+		if (_ret == -1) \
 			err("Out of memory"); \
-	} while (0)
+		_ret; \
+	})