mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
dom event example: Add error check to impl call
Added error checking to virEventRegisterDefaultImpl call for consistency.
This commit is contained in:
parent
90ebc54e9d
commit
854b91cd9f
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user