]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
consistently use svfs for statvfs variables 1356/head
authorSteve Lhomme <robux4@ycbcr.xyz>
Mon, 6 Apr 2020 06:19:44 +0000 (08:19 +0200)
committerSteve Lhomme <robux4@ycbcr.xyz>
Mon, 6 Apr 2020 06:29:45 +0000 (08:29 +0200)
So it cannot be misinterpreted as a statfs which uses the sfs variable name.

libarchive/archive_read_disk_posix.c

index 52fec7bb42c8a715eb5e5d017aa09bbf311e117d..c3b5def5d587d94ec1d82243e291485f91ae9826 100644 (file)
@@ -1658,7 +1658,7 @@ static int
 setup_current_filesystem(struct archive_read_disk *a)
 {
        struct tree *t = a->tree;
-       struct statvfs sfs;
+       struct statvfs svfs;
        int r, xr = 0;
 
        t->current_filesystem->synthetic = -1;
@@ -1667,16 +1667,16 @@ setup_current_filesystem(struct archive_read_disk *a)
                return (ARCHIVE_FAILED);
        }
        if (tree_current_is_symblic_link_target(t)) {
-               r = statvfs(tree_current_access_path(t), &sfs);
+               r = statvfs(tree_current_access_path(t), &svfs);
                if (r == 0)
                        xr = get_xfer_size(t, -1, tree_current_access_path(t));
        } else {
 #ifdef HAVE_FSTATVFS
-               r = fstatvfs(tree_current_dir_fd(t), &sfs);
+               r = fstatvfs(tree_current_dir_fd(t), &svfs);
                if (r == 0)
                        xr = get_xfer_size(t, tree_current_dir_fd(t), NULL);
 #else
-               r = statvfs(".", &sfs);
+               r = statvfs(".", &svfs);
                if (r == 0)
                        xr = get_xfer_size(t, -1, ".");
 #endif
@@ -1688,30 +1688,30 @@ setup_current_filesystem(struct archive_read_disk *a)
        } else if (xr == 1) {
                /* Usually come here unless NetBSD supports _PC_REC_XFER_ALIGN
                 * for pathconf() function. */
-               t->current_filesystem->xfer_align = sfs.f_frsize;
+               t->current_filesystem->xfer_align = svfs.f_frsize;
                t->current_filesystem->max_xfer_size = -1;
 #if defined(HAVE_STRUCT_STATVFS_F_IOSIZE)
-               t->current_filesystem->min_xfer_size = sfs.f_iosize;
-               t->current_filesystem->incr_xfer_size = sfs.f_iosize;
+               t->current_filesystem->min_xfer_size = svfs.f_iosize;
+               t->current_filesystem->incr_xfer_size = svfs.f_iosize;
 #else
-               t->current_filesystem->min_xfer_size = sfs.f_bsize;
-               t->current_filesystem->incr_xfer_size = sfs.f_bsize;
+               t->current_filesystem->min_xfer_size = svfs.f_bsize;
+               t->current_filesystem->incr_xfer_size = svfs.f_bsize;
 #endif
        }
-       if (sfs.f_flag & ST_LOCAL)
+       if (svfs.f_flag & ST_LOCAL)
                t->current_filesystem->remote = 0;
        else
                t->current_filesystem->remote = 1;
 
 #if defined(ST_NOATIME)
-       if (sfs.f_flag & ST_NOATIME)
+       if (svfs.f_flag & ST_NOATIME)
                t->current_filesystem->noatime = 1;
        else
 #endif
                t->current_filesystem->noatime = 0;
 
        /* Set maximum filename length. */
-       t->current_filesystem->name_max = sfs.f_namemax;
+       t->current_filesystem->name_max = svfs.f_namemax;
        return (ARCHIVE_OK);
 }
 
@@ -1864,7 +1864,7 @@ static int
 setup_current_filesystem(struct archive_read_disk *a)
 {
        struct tree *t = a->tree;
-       struct statvfs sfs;
+       struct statvfs svfs;
        int r, xr = 0;
 
        t->current_filesystem->synthetic = -1;/* Not supported */
@@ -1883,7 +1883,7 @@ setup_current_filesystem(struct archive_read_disk *a)
                            "openat failed");
                        return (ARCHIVE_FAILED);
                }
-               r = fstatvfs(fd, &sfs);
+               r = fstatvfs(fd, &svfs);
                if (r == 0)
                        xr = get_xfer_size(t, fd, NULL);
                close(fd);
@@ -1892,13 +1892,13 @@ setup_current_filesystem(struct archive_read_disk *a)
                        archive_set_error(&a->archive, errno, "fchdir failed");
                        return (ARCHIVE_FAILED);
                }
-               r = statvfs(tree_current_access_path(t), &sfs);
+               r = statvfs(tree_current_access_path(t), &svfs);
                if (r == 0)
                        xr = get_xfer_size(t, -1, tree_current_access_path(t));
 #endif
        } else {
 #ifdef HAVE_FSTATVFS
-               r = fstatvfs(tree_current_dir_fd(t), &sfs);
+               r = fstatvfs(tree_current_dir_fd(t), &svfs);
                if (r == 0)
                        xr = get_xfer_size(t, tree_current_dir_fd(t), NULL);
 #else
@@ -1906,7 +1906,7 @@ setup_current_filesystem(struct archive_read_disk *a)
                        archive_set_error(&a->archive, errno, "fchdir failed");
                        return (ARCHIVE_FAILED);
                }
-               r = statvfs(".", &sfs);
+               r = statvfs(".", &svfs);
                if (r == 0)
                        xr = get_xfer_size(t, -1, ".");
 #endif
@@ -1918,14 +1918,14 @@ setup_current_filesystem(struct archive_read_disk *a)
                return (ARCHIVE_FAILED);
        } else if (xr == 1) {
                /* pathconf(_PC_REX_*) operations are not supported. */
-               t->current_filesystem->xfer_align = sfs.f_frsize;
+               t->current_filesystem->xfer_align = svfs.f_frsize;
                t->current_filesystem->max_xfer_size = -1;
-               t->current_filesystem->min_xfer_size = sfs.f_bsize;
-               t->current_filesystem->incr_xfer_size = sfs.f_bsize;
+               t->current_filesystem->min_xfer_size = svfs.f_bsize;
+               t->current_filesystem->incr_xfer_size = svfs.f_bsize;
        }
 
 #if defined(ST_NOATIME)
-       if (sfs.f_flag & ST_NOATIME)
+       if (svfs.f_flag & ST_NOATIME)
                t->current_filesystem->noatime = 1;
        else
 #endif
@@ -1933,7 +1933,7 @@ setup_current_filesystem(struct archive_read_disk *a)
 
 #if defined(USE_READDIR_R)
        /* Set maximum filename length. */
-       t->current_filesystem->name_max = sfs.f_namemax;
+       t->current_filesystem->name_max = svfs.f_namemax;
 #endif
        return (ARCHIVE_OK);
 }