Whamcloud - gitweb
tst_bitops: don't stop testing on low memory
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 11 Aug 2021 15:46:10 +0000 (17:46 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 11 Aug 2021 15:55:11 +0000 (11:55 -0400)
Some build systems have 512 MiB memory or less, e.g. Ubiquity Edgeroute
Lite which can be used to build for the mips and mips64 architectures.

On these allocating 512 MIB will always fail. So if allocating 512 MiB
fails treat this as expected behavior and return 0.

This will allow testing to continue with the remaining tests.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/tst_bitops.c

index 8262d3b..adef12d 100644 (file)
@@ -104,7 +104,7 @@ int main(int argc, char **argv)
        bigarray = malloc(1 << 29);
        if (!bigarray) {
                fprintf(stderr, "Failed to allocate scratch memory!\n");
-               exit(1);
+               exit(0);
        }
 
         bigarray[BIG_TEST_BIT >> 3] = 0;