From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [COMMITTED] [PATCH 1/2] SAFE_MACROS: Add SAFE_EXECLP()
Date: Tue, 1 Nov 2016 10:27:28 +0100 [thread overview]
Message-ID: <20161101092728.GA18406@rei.lan> (raw)
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
reply other threads:[~2016-11-01 9:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20161101092728.GA18406@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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