]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
depmod: fix modules.builtin.alias.bin output
authorLucas De Marchi <lucas.demarchi@intel.com>
Tue, 11 May 2021 16:48:04 +0000 (09:48 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Tue, 11 May 2021 16:49:35 +0000 (09:49 -0700)
Due to wrong documentation on kmod_module_get_info() we ended up
checking for 0 as return. Check for > 0 to decided if we want to write
the index to the file, otherwise we would output a 0-sized index on
success.

tools/depmod.c

index 170a1d8d3f3d0564f129baa87cfb5c9849868f77..eb810b811e359e49cf3a77c722b5c5b0e4771d38 100644 (file)
@@ -2457,7 +2457,7 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out)
 
 out:
        /* do not bother writing the index if we are going to discard it */
-       if (!ret)
+       if (ret > 0)
                index_write(idx, out);
 
        if (builtin)