diff options
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kmod.c | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kmod.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kmod.c index e00133d64..f80b30d3e 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kmod.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kmod.c @@ -10,6 +10,16 @@ #define MAX_PATH 1024 +/* XFree86 #defines execl to be the xf86execl() function which does + * a fork AND exec. We don't want that. We want the regular, + * standard execl(). + */ +#ifdef execl +#undef execl +#endif + + + /* * Load a Linux kernel module. * This is used by the DRI/DRM to load a DRM kernel module when @@ -44,47 +54,26 @@ int xf86LoadKernelModule(const char *modName) xf86strcpy(mpPath, "/sbin/modprobe"); } - /*ErrorF(">>> pre-fork\n");*/ - /* now fork/exec the modprobe command */ switch (pid = fork()) { case 0: /* child */ - /*ErrorF(">>> execl begin\n");*/ - n = execl(mpPath, "modprobe", "-v", modName, NULL); - /*ErrorF(">>> execl failed %d\n", n);*/ - if (n) { - /*ErrorF(">>> n is true\n");*/ - exit(EXIT_FAILURE); /* if we get here the child's exec failed */ - } - else { - /*ErrorF(">>> n is false\n");*/ - exit(0); - } + n = execl(mpPath, "modprobe", modName, NULL); + exit(EXIT_FAILURE); /* if we get here the child's exec failed */ break; case -1: /* fork failed */ return 0; default: /* fork worked */ - /*ErrorF(">>> waiting\n");*/ if (waitpid(pid, &status, 0) == -1) { - /*ErrorF(">>> waitpid failed\n");*/ return 0; } - /* - ErrorF(">>> status = %d\n", status); - ErrorF(">>> WIFEXITED(status) = %d\n", WIFEXITED(status)); - ErrorF(">>> WEXITSTATUS(status) = %d\n", WEXITSTATUS(status)); - */ if (WIFEXITED(status) && WEXITSTATUS(status) == 0) { - /*ErrorF(">>> success\n");*/ return 1; /* success! */ } else { - /*ErrorF(">>> failure\n");*/ return 0; } } /* never get here */ - /*ErrorF(">>> never get here\n");*/ return 0; } |