* [LTP] [COMMITTED] [PATCH 1/2] SAFE_MACROS: Add SAFE_EXECLP()
@ 2016-11-01 9:27 Cyril Hrubis
0 siblings, 0 replies; only message in thread
From: Cyril Hrubis @ 2016-11-01 9:27 UTC (permalink / raw)
To: ltp
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
include/tst_safe_macros.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/tst_safe_macros.h b/include/tst_safe_macros.h
index 3cf154e..d1519f9 100644
--- a/include/tst_safe_macros.h
+++ b/include/tst_safe_macros.h
@@ -427,4 +427,10 @@ static inline sighandler_t safe_signal(const char *file, const int lineno,
#define SAFE_SIGNAL(signum, handler) \
safe_signal(__FILE__, __LINE__, (signum), (handler))
+#define SAFE_EXECLP(file, arg, ...) do { \
+ execlp((file), (arg), ##__VA_ARGS__); \
+ tst_brk_(__FILE__, __LINE__, TBROK | TERRNO, \
+ "execlp(%s, %s, ...) failed", file, arg); \
+ } while (0)
+
#endif /* SAFE_MACROS_H__ */
--
2.7.3
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-11-01 9:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-01 9:27 [LTP] [COMMITTED] [PATCH 1/2] SAFE_MACROS: Add SAFE_EXECLP() Cyril Hrubis
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.