提交 cbe289d8 编写于 作者: M Michal Privoznik

event-test: Check for virConnectRegisterCloseCallback return value

In an unlikely event of virConnectRegisterCloseCallback failing,
the error is ignored. This is an example file and we shouldn't
get a bad example.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 bde75a89
......@@ -668,8 +668,11 @@ int main(int argc, char **argv)
goto cleanup;
}
virConnectRegisterCloseCallback(dconn,
connectClose, NULL, NULL);
if (virConnectRegisterCloseCallback(dconn,
connectClose, NULL, NULL) < 0) {
fprintf(stderr, "Unable to register close callback\n");
goto cleanup;
}
sigaction(SIGTERM, &action_stop, NULL);
sigaction(SIGINT, &action_stop, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册