Re: [PATCH] build: fix build without posix_fallocate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/05/2013 08:34 PM, Eric Blake wrote:
> Such as on FreeBSD.  Broken in commit aa2a4cff7
> 
> * src/util/virstoragefile.c (virStorageFileResize): Add missing ';'.
> 
> Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
> ---
> 
> Pushing under the build-breaker rule.
> 
>  src/util/virstoragefile.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
> index bf668c8..b861fd8 100644
> --- a/src/util/virstoragefile.c
> +++ b/src/util/virstoragefile.c
> @@ -1074,7 +1074,7 @@ virStorageFileResize(const char *path,
>          }
>  #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 {
> 

Actually squashing this in first, to avoid the next failure of unused
variables.  Also, I really think we should ditch the code protected by:
 #elif HAVE_SYS_SYSCALL_H && defined(SYS_fallocate)
as it is extremely unlikely these days to have a kernel with fallocate
but a glibc that lacks the wrapper.  Anyone on a system that out-of-date
deserves to not be able to use this feature.

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index bf668c8..b985df4 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -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);

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]