]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Do not find out a filesystem status when the symlink is broken.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Mon, 3 Jan 2011 09:54:49 +0000 (04:54 -0500)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Mon, 3 Jan 2011 09:54:49 +0000 (04:54 -0500)
statfs will be failed by its brokenness.

SVN-Revision: 2857

libarchive/archive_read_disk_posix.c
libarchive/archive_read_disk_windows.c

index b3195609c5932cd8b24cb692138f5b6a51a8dd9e..f700e07c2ea1c683fdaade46297cb56c74291216 100644 (file)
@@ -862,6 +862,16 @@ update_filesystem(struct archive_read_disk *a, int64_t dev)
                t->current_filesystem->name_max = PATH_MAX;
 # endif /* NAME_MAX */
 #endif /* HAVE_READDIR_R */
+
+       /*
+        * When symlink is broken, we cannot find out what current
+        * filesystem is.
+        */
+       if (tree_current_stat(a->tree) == NULL) {
+               t->current_filesystem->synthetic = -1;/* Not supported */
+               t->current_filesystem->remote = -1;/* Not supported */
+               return (ARCHIVE_OK);
+       }
        return (setup_current_filesystem(a));
 }
 
index 1afb1fdc010ca19a95940f58a246495a3069c68c..5e871ee94f3cbb87c4fd264699fe70354052ab62 100644 (file)
@@ -951,6 +951,16 @@ update_filesystem(struct archive_read_disk *a, int64_t dev)
        t->current_filesystem_id = fid;
        t->current_filesystem = &(t->filesystem_table[fid]);
        t->current_filesystem->dev = dev;
+
+       /*
+        * When symlink is broken, we cannot find out what current
+        * filesystem is.
+        */
+       if (tree_current_stat(a->tree) == NULL) {
+               t->current_filesystem->synthetic = -1;/* Not supported */
+               t->current_filesystem->remote = -1;/* Not supported */
+               return (ARCHIVE_OK);
+       }
        return (setup_current_filesystem(a));
 }