libkmod: allow modules.alias.builtin to be optional
Lucas De Marchi
4 years ago
854 | 854 | */ |
855 | 855 | KMOD_EXPORT int kmod_load_resources(struct kmod_ctx *ctx) |
856 | 856 | { |
857 | int ret = 0; | |
857 | 858 | size_t i; |
858 | int ret; | |
859 | 859 | |
860 | 860 | if (ctx == NULL) |
861 | 861 | return -ENOENT; |
873 | 873 | index_files[i].fn); |
874 | 874 | ret = index_mm_open(ctx, path, &ctx->indexes_stamp[i], |
875 | 875 | &ctx->indexes[i]); |
876 | if (ret) | |
877 | break; | |
876 | ||
877 | /* | |
878 | * modules.builtin.alias are considered optional since it's | |
879 | * recently added and older installations may not have it; | |
880 | * we allow failing for any reason | |
881 | */ | |
882 | if (ret) { | |
883 | if (i != KMOD_INDEX_MODULES_BUILTIN_ALIAS) | |
884 | break; | |
885 | ret = 0; | |
886 | } | |
878 | 887 | } |
879 | 888 | |
880 | 889 | if (ret) |