int main(int argc, char *argv[]) {
struct dirent **de = NULL;
int main(int argc, char *argv[]) {
struct dirent **de = NULL;
char **arguments = NULL;
unsigned n_arguments = 0, n_allocated = 0;
if (argc > 1) {
log_error("This program takes no argument.");
char **arguments = NULL;
unsigned n_arguments = 0, n_allocated = 0;
if (argc > 1) {
log_error("This program takes no argument.");
if ((n = scandir("/etc/modules.d/", &de, scandir_filter, alphasort)) < 0) {
if (errno == ENOENT)
if ((n = scandir("/etc/modules.d/", &de, scandir_filter, alphasort)) < 0) {
if (errno == ENOENT)
if (!(a = realloc(arguments, sizeof(char*) * (m+1)))) {
log_error("Failed to increase module array size.");
free(t);
if (!(a = realloc(arguments, sizeof(char*) * (m+1)))) {
log_error("Failed to increase module array size.");
free(t);
execv("/sbin/modprobe", arguments);
log_error("Failed to execute /sbin/modprobe: %m");
execv("/sbin/modprobe", arguments);
log_error("Failed to execute /sbin/modprobe: %m");