]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
createRawFileOpHook: avoid dead stores
authorJim Meyering <meyering@redhat.com>
Wed, 7 Apr 2010 16:30:55 +0000 (18:30 +0200)
committerJim Meyering <meyering@redhat.com>
Wed, 7 Apr 2010 19:49:07 +0000 (21:49 +0200)
* src/storage/storage_backend.c (createRawFileOpHook): Remove dead
stores and declaration of each stored-to variable.

src/storage/storage_backend.c

index 7294a009dcbb6becf01e50fa650e7ea6c3614eb7..f0074ed04c0f3f3914811be8e26d470cb849ecbb 100644 (file)
@@ -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);