]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
- Add the NetBSD-specific config.h
authorzoulasc <christos@zoulas.com>
Thu, 16 Jan 2020 20:29:57 +0000 (15:29 -0500)
committerzoulasc <christos@zoulas.com>
Thu, 16 Jan 2020 20:29:57 +0000 (15:29 -0500)
- Use --help instead of -V when -V exits with non-zero code
- Double the string size to prevent truncation

test_utils/test_common.h
test_utils/test_main.c

index e12c152c0cb5dc6f73acc688e1d619eca3900576..6604732066c1907cd6a98c8617a564bcc77c965c 100644 (file)
@@ -38,6 +38,9 @@
 #elif defined(__FreeBSD__)
 /* Building as part of FreeBSD system requires a pre-built config.h. */
 #include "config_freebsd.h"
+#elif defined(__NetBSD__)
+/* Building as part of NetBSD system requires a pre-built config.h. */
+#include "config_netbsd.h"
 #elif defined(_WIN32) && !defined(__CYGWIN__)
 /* Win32 can't run the 'configure' script. */
 #include "config_windows.h"
index 1b44edf171d96f446ca0bdb75c1d64079f4721f1..c34c0249fb7296f1a51d018eb3167ca6117195d8 100644 (file)
@@ -2480,7 +2480,7 @@ canBzip2(void)
        static int tested = 0, value = 0;
        if (!tested) {
                tested = 1;
-               if (systemf("bzip2 -d -V %s", redirectArgs) == 0)
+               if (systemf("bzip2 --help %s", redirectArgs) == 0)
                        value = 1;
        }
        return (value);
@@ -2510,7 +2510,7 @@ canGzip(void)
        static int tested = 0, value = 0;
        if (!tested) {
                tested = 1;
-               if (systemf("gzip -V %s", redirectArgs) == 0)
+               if (systemf("gzip --help %s", redirectArgs) == 0)
                        value = 1;
        }
        return (value);
@@ -2552,7 +2552,7 @@ canLz4(void)
        static int tested = 0, value = 0;
        if (!tested) {
                tested = 1;
-               if (systemf("lz4 -V %s", redirectArgs) == 0)
+               if (systemf("lz4 --help %s", redirectArgs) == 0)
                        value = 1;
        }
        return (value);
@@ -2567,7 +2567,7 @@ canZstd(void)
        static int tested = 0, value = 0;
        if (!tested) {
                tested = 1;
-               if (systemf("zstd -V %s", redirectArgs) == 0)
+               if (systemf("zstd --help %s", redirectArgs) == 0)
                        value = 1;
        }
        return (value);
@@ -2582,7 +2582,7 @@ canLzip(void)
        static int tested = 0, value = 0;
        if (!tested) {
                tested = 1;
-               if (systemf("lzip -V %s", redirectArgs) == 0)
+               if (systemf("lzip --help %s", redirectArgs) == 0)
                        value = 1;
        }
        return (value);
@@ -2597,7 +2597,7 @@ canLzma(void)
        static int tested = 0, value = 0;
        if (!tested) {
                tested = 1;
-               if (systemf("lzma -V %s", redirectArgs) == 0)
+               if (systemf("lzma %s", redirectArgs) == 0)
                        value = 1;
        }
        return (value);
@@ -2612,7 +2612,7 @@ canLzop(void)
        static int tested = 0, value = 0;
        if (!tested) {
                tested = 1;
-               if (systemf("lzop -V %s", redirectArgs) == 0)
+               if (systemf("lzop --help %s", redirectArgs) == 0)
                        value = 1;
        }
        return (value);
@@ -2627,7 +2627,7 @@ canXz(void)
        static int tested = 0, value = 0;
        if (!tested) {
                tested = 1;
-               if (systemf("xz -V %s", redirectArgs) == 0)
+               if (systemf("xz --help %s", redirectArgs) == 0)
                        value = 1;
        }
        return (value);
@@ -3499,9 +3499,9 @@ static int
 test_run(int i, const char *tmpdir)
 {
 #ifdef PATH_MAX
-       char workdir[PATH_MAX];
+       char workdir[PATH_MAX * 2];
 #else
-       char workdir[1024];
+       char workdir[1024 * 2];
 #endif
        char logfilename[64];
        int failures_before = failures;