From: Michihiro NAKAJIMA Date: Mon, 9 Jan 2012 03:03:19 +0000 (-0500) Subject: If linux major version is 3 or later we can test sparse files. X-Git-Tag: v3.0.4~2^2~211 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47b95d1fa9ead3ec98a93aeafe3710518ba5a6b1;p=thirdparty%2Flibarchive.git If linux major version is 3 or later we can test sparse files. SVN-Revision: 4097 --- diff --git a/libarchive/test/test_sparse_basic.c b/libarchive/test/test_sparse_basic.c index 0656f2ff7..52d76c601 100644 --- a/libarchive/test/test_sparse_basic.c +++ b/libarchive/test/test_sparse_basic.c @@ -183,14 +183,16 @@ is_sparse_supported(const char *path) d = strtol(p, &e, 10); if (d < 2 || *e != '.') return (0); - p = e + 1; - d = strtol(p, &e, 10); - if (d < 6 || *e != '.') - return (0); - p = e + 1; - d = strtol(p, NULL, 10); - if (d < 28) - return (0); + if (d == 2) { + p = e + 1; + d = strtol(p, &e, 10); + if (d < 6 || *e != '.') + return (0); + p = e + 1; + d = strtol(p, NULL, 10); + if (d < 28) + return (0); + } create_sparse_file(testfile, sparse_file); fd = open(testfile, O_RDWR); if (fd < 0)