]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: fix build without posix_fallocate
authorEric Blake <eblake@redhat.com>
Thu, 6 Jun 2013 02:33:15 +0000 (20:33 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 6 Jun 2013 02:38:31 +0000 (20:38 -0600)
Such as on FreeBSD.  Broken in commit aa2a4cff7.

* src/util/virstoragefile.c (virStorageFileResize): Add missing ';',
mark conditionally unused variables.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/util/virstoragefile.c

index bf668c89dd4750d4d9c15c07045268e75dfcbaf5..b985df461a42ffd51cec7a4d08a5c54344b40217 100644 (file)
@@ -1048,9 +1048,12 @@ virStorageFileResize(const char *path,
 {
     int fd = -1;
     int ret = -1;
-    int rc;
-    off_t offset = orig_capacity;
-    off_t len = capacity - orig_capacity;
+    int rc ATTRIBUTE_UNUSED;
+    off_t offset ATTRIBUTE_UNUSED;
+    off_t len ATTRIBUTE_UNUSED;
+
+    offset = orig_capacity;
+    len = capacity - orig_capacity;
 
     if ((fd = open(path, O_RDWR)) < 0) {
         virReportSystemError(errno, _("Unable to open '%s'"), path);
@@ -1068,13 +1071,13 @@ virStorageFileResize(const char *path,
 #elif HAVE_SYS_SYSCALL_H && defined(SYS_fallocate)
         if (syscall(SYS_fallocate, fd, 0, offset, len) != 0) {
             virReportSystemError(errno,
-                                 _("Failed to preallocate space for "
+                                 _("Failed to pre-allocate space for "
                                    "file '%s'"), path);
             goto cleanup;
         }
 #else
         virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
-                       _("preallocate is not supported on this platform"))
+                       _("preallocate is not supported on this platform"));
         goto cleanup;
 #endif
     } else {