提交 2cdf29ed 编写于 作者: J Jim Meyering

createRawFileOpHook: avoid dead stores

* src/storage/storage_backend.c (createRawFileOpHook): Remove dead
stores and declaration of each stored-to variable.
上级 5874c6de
......@@ -308,12 +308,11 @@ static int createRawFileOpHook(int fd, void *data) {
* update every 9s is a fair-enough trade-off
*/
unsigned long long bytes = 512 * 1024 * 1024;
int r;
if (bytes > remain)
bytes = remain;
if ((r = safezero(fd, 0, hdata->vol->allocation - remain,
bytes)) != 0) {
if (safezero(fd, 0, hdata->vol->allocation - remain,
bytes) != 0) {
ret = errno;
virReportSystemError(errno, _("cannot fill file '%s'"),
hdata->vol->target.path);
......@@ -322,9 +321,7 @@ static int createRawFileOpHook(int fd, void *data) {
remain -= bytes;
}
} else { /* No progress bars to be shown */
int r;
if ((r = safezero(fd, 0, 0, remain)) != 0) {
if (safezero(fd, 0, 0, remain) != 0) {
ret = errno;
virReportSystemError(errno, _("cannot fill file '%s'"),
hdata->vol->target.path);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册