X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fmodules-load.c;h=3e3ccb0c2f2f188b3939497b8d0b1db091b57aa1;hp=bfe5b8a995e3f9f866a10f162374acfcb5258db6;hb=9d3e691e709eb12ce48a3dec6e50537406d12ad2;hpb=22f4096ca96acd504ac74e7dfad96f07edb6da51 diff --git a/src/modules-load.c b/src/modules-load.c index bfe5b8a99..3e3ccb0c2 100644 --- a/src/modules-load.c +++ b/src/modules-load.c @@ -31,7 +31,7 @@ #include "util.h" #include "strv.h" -/* This reads all module names listed in /etc/modules.d/?*.modules and +/* This reads all module names listed in /etc/modules-load.d/?*.conf and * loads them into the kernel. This follows roughly Debian's way to * handle modules, but uses a directory of fragments instead of a * single /etc/modules file. */ @@ -46,7 +46,7 @@ static int scandir_filter(const struct dirent *d) { d->d_type != DT_LNK) return 0; - return endswith(d->d_name, ".modules"); + return endswith(d->d_name, ".conf"); } int main(int argc, char *argv[]) { @@ -71,12 +71,12 @@ int main(int argc, char *argv[]) { n_arguments = n_allocated = 3; - if ((n = scandir("/etc/modules.d/", &de, scandir_filter, alphasort)) < 0) { + if ((n = scandir("/etc/modules-load.d/", &de, scandir_filter, alphasort)) < 0) { if (errno == ENOENT) r = EXIT_SUCCESS; else - log_error("Failed to enumerate /etc/modules.d/ files: %m"); + log_error("Failed to enumerate /etc/modules-load.d/ files: %m"); goto finish; } @@ -88,7 +88,7 @@ int main(int argc, char *argv[]) { char *fn; FILE *f; - k = asprintf(&fn, "/etc/modules.d/%s", de[i]->d_name); + k = asprintf(&fn, "/etc/modules-load.d/%s", de[i]->d_name); free(de[i]); if (k < 0) { @@ -101,6 +101,9 @@ int main(int argc, char *argv[]) { free(fn); if (!f) { + if (errno == ENOENT) + continue; + log_error("Failed to open %s: %m", fn); r = EXIT_FAILURE; continue;