off_t size,
int fd)
{
- int ret = -1;
-
- ret = ftruncate(fd, 0);
- if (ret == -1) {
+ if (ftruncate(fd, 0) < 0) {
virReportSystemError(errno,
_("Failed to truncate volume with "
"path '%s' to 0 bytes"),
vol->target.path);
- return ret;
+ return -1;
}
- ret = ftruncate(fd, size);
- if (ret == -1) {
+ if (ftruncate(fd, size) < 0) {
virReportSystemError(errno,
_("Failed to truncate volume with "
"path '%s' to %ju bytes"),
vol->target.path, (uintmax_t)size);
+ return -1;
}
- return ret;
+ return 0;
}
virCommandSetErrorFD(cmd, &logfd);
virCommandDaemonize(cmd);
- ret = virCommandRun(cmd, NULL);
- if (ret < 0)
+ if (virCommandRun(cmd, NULL) < 0)
goto cleanup;
if (autoDestroy &&
- (ret = umlProcessAutoDestroyAdd(driver, vm, conn)) < 0)
+ umlProcessAutoDestroyAdd(driver, vm, conn) < 0)
goto cleanup;
ret = virDomainObjSetDefTransient(driver->caps, driver->xmlopt, vm, false);