提交 b1d3154a 编写于 作者: D Daniel P. Berrange

Ensure LD_PRELOAD exists before running test case

The linker will ignore LD_PRELOAD libraries which do not
exist, just printing a warning message. This is not helpful
for the test suite which will be utterly fubar without the
preload library present. Add an explicit test for existence
of the library to protect against this
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 8ef2b2c5
......@@ -75,6 +75,10 @@ int virtTestMain(int argc,
const char *preload = getenv("LD_PRELOAD"); \
if (preload == NULL || strstr(preload, lib) == NULL) { \
char *newenv; \
if (!virFileIsExecutable(lib)) { \
perror(lib); \
return EXIT_FAILURE; \
} \
if (virAsprintf(&newenv, "%s%s%s", preload ? preload : "", \
preload ? ":" : "", lib) < 0) { \
perror("virAsprintf"); \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册