if (!(home = virGetUserDirectory()))
goto cleanup;
- if (virAsprintf(&old_base, "%s/.libvirt", home) < 0) {
+ if (virAsprintf(&old_base, "%s/.libvirt", home) < 0)
goto cleanup;
- }
/* if the new directory is there or the old one is not: do nothing */
if (!(config_dir = virGetUserConfigDirectory()))
}
/* test if we already attempted to migrate first */
- if (virAsprintf(&updated, "%s/DEPRECATED-DIRECTORY", old_base) < 0) {
+ if (virAsprintf(&updated, "%s/DEPRECATED-DIRECTORY", old_base) < 0)
goto cleanup;
- }
- if (virFileExists(updated)) {
+ if (virFileExists(updated))
goto cleanup;
- }
config_home = virGetEnvBlockSUID("XDG_CONFIG_HOME");
if (config_home && config_home[0] != '\0') {
if (VIR_STRDUP(xdg_dir, config_home) < 0)
goto cleanup;
} else {
- if (virAsprintf(&xdg_dir, "%s/.config", home) < 0) {
+ if (virAsprintf(&xdg_dir, "%s/.config", home) < 0)
goto cleanup;
- }
}
old_umask = umask(077);
c = getopt_long(argc, argv, "ldf:p:t:vVh", opts, &optidx);
- if (c == -1) {
+ if (c == -1)
break;
- }
switch (c) {
case 0:
authScheme, callback->callbackID);
VIR_DEBUG("Subject %d", subject->nidentity);
- for (i = 0; i < subject->nidentity; i++) {
+ for (i = 0; i < subject->nidentity; i++)
VIR_DEBUG(" %s=%s", subject->identities[i].type, subject->identities[i].name);
- }
/* build return data */
memset(&data, 0, sizeof(data));
cleanup:
VIR_FORCE_CLOSE(fd);
- if (rv < 0) {
+ if (rv < 0)
virNetMessageSaveError(rerr);
- }
if (dom)
virDomainFree(dom);
rv = 0;
cleanup:
- for (i = 0; i < nfiles; i++) {
+ for (i = 0; i < nfiles; i++)
VIR_FORCE_CLOSE(files[i]);
- }
VIR_FREE(files);
if (rv < 0)
virNetMessageSaveError(rerr);
rv = 0;
cleanup:
- for (i = 0; i < nfiles; i++) {
+ for (i = 0; i < nfiles; i++)
VIR_FORCE_CLOSE(files[i]);
- }
VIR_FREE(files);
if (rv < 0)
virNetMessageSaveError(rerr);
virConnectUnregisterCloseCallback(dconn, connectClose);
VIR_DEBUG("Closing connection");
- if (dconn && virConnectClose(dconn) < 0) {
+ if (dconn && virConnectClose(dconn) < 0)
printf("error closing\n");
- }
printf("done\n");
return 0;
goto out;
}
- if (numNames > 0) {
+ if (numNames > 0)
printf("Inactive domains:\n");
- }
for (i = 0; i < numNames; i++) {
printf(" %s\n", *(nameList + i));
case VIR_CRED_AUTHNAME:
cred[i].result = strdup(authData->username);
- if (cred[i].result == NULL) {
+ if (cred[i].result == NULL)
return -1;
- }
cred[i].resultlen = strlen(cred[i].result);
break;
case VIR_CRED_PASSPHRASE:
cred[i].result = strdup(authData->password);
- if (cred[i].result == NULL) {
+ if (cred[i].result == NULL)
return -1;
- }
cred[i].resultlen = strlen(cred[i].result);
break;