aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-10-23 02:05:30 -0400
committerMike Frysinger <vapier@gentoo.org>2021-10-23 02:05:30 -0400
commit3459f28f82fdf4e1da0b6ca0d24d00ce4dfd0fe7 (patch)
treebafcffc39e5a0b59512ac6d5326cbc3958807474 /libsbutil
parenttests: merge into top level makefile too (diff)
downloadsandbox-3459f28f82fdf4e1da0b6ca0d24d00ce4dfd0fe7.tar.gz
sandbox-3459f28f82fdf4e1da0b6ca0d24d00ce4dfd0fe7.tar.bz2
sandbox-3459f28f82fdf4e1da0b6ca0d24d00ce4dfd0fe7.zip
sandbox: add a --run-configure option
When setting up sandbox on a new system for development, it helps to be able to build the new sandbox checkout in the same way as it is currently installed in the system. Add a command line option for this explicitly to speed up development. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libsbutil')
-rw-r--r--libsbutil/sbutil.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libsbutil/sbutil.h b/libsbutil/sbutil.h
index 5194dde..d81543b 100644
--- a/libsbutil/sbutil.h
+++ b/libsbutil/sbutil.h
@@ -153,6 +153,14 @@ char *__xstrndup(const char *str, size_t size, const char *file, const char *fun
#define xstrndup(_str, _size) __xstrndup(_str, _size, __FILE__, __func__, __LINE__)
#define xalloc_die() __sb_ebort(__FILE__, __func__, __LINE__, "out of memory")
+#define xasprintf(fmt, ...) \
+({ \
+ int _ret = asprintf(fmt, __VA_ARGS__); \
+ if (_ret == 0) \
+ sb_perr("asprintf(%s) failed", #fmt); \
+ _ret; \
+})
+
/* string helpers */
#define streq(s1, s2) (strcmp(s1, s2) == 0)