This file is created by depmod even if there's no node. In this case it
will be empty.
Previously 'kmod static-nodes' was segfaulting due to passing in==NULL
to fgets.
Also show the error message with %m.
ret = EXIT_FAILURE;
goto finish;
}
+
snprintf(modules, sizeof(modules), "/lib/modules/%s/modules.devname", kernel.release);
in = fopen(modules, "re");
- if (in == NULL && errno != ENOENT) {
- fprintf(stderr, "Error: could not open /lib/modules/%s/modules.devname!\n", kernel.release);
+ if (in == NULL) {
+ fprintf(stderr, "Error: could not open /lib/modules/%s/modules.devname - %m\n", kernel.release);
ret = EXIT_FAILURE;
goto finish;
}