dom event example: Add error check to impl call

Added error checking to virEventRegisterDefaultImpl call for consistency.
This commit is contained in:
Jesse J. Cook 2013-05-09 16:17:44 -05:00 committed by Michal Privoznik
parent 90ebc54e9d
commit 854b91cd9f

View File

@ -473,7 +473,12 @@ int main(int argc, char **argv)
return -1;
}
virEventRegisterDefaultImpl();
if (virEventRegisterDefaultImpl() < 0) {
virErrorPtr err = virGetLastError();
fprintf(stderr, "Failed to register event implementation: %s\n",
err && err->message ? err->message: "Unknown error");
return -1;
}
virConnectPtr dconn = NULL;
dconn = virConnectOpenAuth(argc > 1 ? argv[1] : NULL,