summaryrefslogtreecommitdiffstats
path: root/loader/modules.c
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2000-04-24 21:53:35 +0000
committerErik Troan <ewt@redhat.com>2000-04-24 21:53:35 +0000
commitf6ee8c9c36b03da7bbde8d700ac15c07b868eef4 (patch)
tree7313e4f1e062fceed6dacffcc2025fea0b009434 /loader/modules.c
parentcbb528b0e967f1fd8b51c763916a8dd39003f679 (diff)
downloadanaconda-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.c24
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) {