summaryrefslogtreecommitdiff
path: root/hw/xfree86/loader
diff options
context:
space:
mode:
authorAdam Jackson <ajax@theobromine.nwnk.net>2006-07-21 22:55:41 -0400
committerAdam Jackson <ajax@theobromine.nwnk.net>2006-07-21 22:55:41 -0400
commit114264584ca43091a5e07282566a30a6378a1502 (patch)
tree1b0ac0a64ff750be6174904bafe410565c83f386 /hw/xfree86/loader
parent985611d5cd079f97da700c7b8e898d33da004be0 (diff)
Remove a useless open() of the module we're about to load.
Diffstat (limited to 'hw/xfree86/loader')
-rw-r--r--hw/xfree86/loader/dlloader.c2
-rw-r--r--hw/xfree86/loader/dlloader.h2
-rw-r--r--hw/xfree86/loader/loader.c15
3 files changed, 3 insertions, 16 deletions
diff --git a/hw/xfree86/loader/dlloader.c b/hw/xfree86/loader/dlloader.c
index 7db04b1a0..a0e867056 100644
--- a/hw/xfree86/loader/dlloader.c
+++ b/hw/xfree86/loader/dlloader.c
@@ -129,7 +129,7 @@ DLFindSymbol(const char *name)
}
void *
-DLLoadModule(loaderPtr modrec, int fd, int flags)
+DLLoadModule(loaderPtr modrec, int flags)
{
DLModulePtr dlfile;
DLModuleList *l;
diff --git a/hw/xfree86/loader/dlloader.h b/hw/xfree86/loader/dlloader.h
index b705a18d0..8ae610f02 100644
--- a/hw/xfree86/loader/dlloader.h
+++ b/hw/xfree86/loader/dlloader.h
@@ -26,7 +26,7 @@
#ifndef _DLLOADER_H
#define _DLLOADER_H
-extern void *DLLoadModule(loaderPtr, int, int flags);
+extern void *DLLoadModule(loaderPtr, int flags);
extern void DLUnloadModule(void *);
extern void *DLFindSymbol(const char *name);
diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index 42a9d3cd3..ddd624c2a 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -313,7 +313,6 @@ LoaderOpen(const char *module, const char *cname, int handle,
{
loaderPtr tmp;
int new_handle;
- int fd;
#if defined(DEBUG)
ErrorF("LoaderOpen(%s)\n", module);
@@ -369,16 +368,6 @@ LoaderOpen(const char *module, const char *cname, int handle,
freeHandles[new_handle] = HANDLE_USED;
refCount[new_handle] = 1;
- if ((fd = open(module, O_RDONLY)) < 0) {
- xf86Msg(X_ERROR, "Unable to open %s\n", module);
- freeHandles[new_handle] = HANDLE_FREE;
- if (errmaj)
- *errmaj = LDR_NOMODOPEN;
- if (errmin)
- *errmin = errno;
- return -1;
- }
-
tmp = _LoaderListPush();
tmp->name = malloc(strlen(module) + 1);
strcpy(tmp->name, module);
@@ -387,7 +376,7 @@ LoaderOpen(const char *module, const char *cname, int handle,
tmp->handle = new_handle;
tmp->module = moduleseq++;
- if ((tmp->private = DLLoadModule(tmp, fd, flags)) == NULL) {
+ if ((tmp->private = DLLoadModule(tmp, flags)) == NULL) {
xf86Msg(X_ERROR, "Failed to load %s\n", module);
_LoaderListPop(new_handle);
freeHandles[new_handle] = HANDLE_FREE;
@@ -398,8 +387,6 @@ LoaderOpen(const char *module, const char *cname, int handle,
return -1;
}
- close(fd);
-
return new_handle;
}