diff --git a/examples/c/domain/dommigrate.c b/examples/c/domain/dommigrate.c index b1641efb9a..3d32ada6d3 100644 --- a/examples/c/domain/dommigrate.c +++ b/examples/c/domain/dommigrate.c @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) { char *src_uri, *dst_uri, *domname; - int ret = 0; + int ret = EXIT_FAILURE; virConnectPtr conn = NULL; virDomainPtr dom = NULL; @@ -52,7 +52,6 @@ main(int argc, char *argv[]) printf("Attempting to connect to the source hypervisor...\n"); conn = virConnectOpenAuth(src_uri, virConnectAuthPtrDefault, 0); if (!conn) { - ret = 1; fprintf(stderr, "No connection to the source hypervisor: %s.\n", virGetLastErrorMessage()); goto out; @@ -74,6 +73,7 @@ main(int argc, char *argv[]) } printf("Migration finished with success.\n"); + ret = EXIT_SUCCESS; cleanup: if (dom != NULL)