diff options
author | Erik Troan <ewt@redhat.com> | 2000-04-24 21:53:35 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 2000-04-24 21:53:35 +0000 |
commit | f6ee8c9c36b03da7bbde8d700ac15c07b868eef4 (patch) | |
tree | 7313e4f1e062fceed6dacffcc2025fea0b009434 /loader/modules.c | |
parent | cbb528b0e967f1fd8b51c763916a8dd39003f679 (diff) | |
download | anaconda-f6ee8c9c36b03da7bbde8d700ac15c07b868eef4.tar.gz anaconda-f6ee8c9c36b03da7bbde8d700ac15c07b868eef4.tar.xz anaconda-f6ee8c9c36b03da7bbde8d700ac15c07b868eef4.zip |
give better errors for failed insmod's
Diffstat (limited to 'loader/modules.c')
-rw-r--r-- | loader/modules.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/loader/modules.c b/loader/modules.c index 8a3d2f8f9..5c8de1910 100644 --- a/loader/modules.c +++ b/loader/modules.c @@ -6,6 +6,7 @@ #include <stdlib.h> #include <string.h> #include <sys/stat.h> +#include <sys/wait.h> #include <unistd.h> #include "isys/isys.h" @@ -200,6 +201,8 @@ int mlLoadModule(char * modName, char * path, moduleList modLoaded, char ** arg, ** newArgs; struct moduleInfo * mi; int ethDevices = -1; + pid_t child; + int status; if (mlModuleInList(modName, modLoaded)) { return 0; @@ -237,7 +240,26 @@ int mlLoadModule(char * modName, char * path, moduleList modLoaded, } else { logMessage("going to insmod %s (path is %s)", fileName, path ? path : "NULL"); - rc = insmod(fileName, path, args); + + if (!(child = fork())) { + int fd = open("/dev/tty3", O_RDWR); + + dup2(fd, 0); + dup2(fd, 1); + dup2(fd, 2); + close(fd); + + rc = insmod(fileName, path, args); + _exit(rc); + } + + waitpid(child, &status, 0); + + if (!WIFEXITED(status) || WEXITSTATUS(status)) { + rc = 1; + } else { + rc = 0; + } } if (!rc) { |