xserver: Branch 'master'

Adam Jackson ajax at kemper.freedesktop.org
Fri Jul 21 20:57:37 PDT 2006


 hw/xfree86/loader/dlloader.c |    2 +-
 hw/xfree86/loader/dlloader.h |    2 +-
 hw/xfree86/loader/loader.c   |   15 +--------------
 3 files changed, 3 insertions(+), 16 deletions(-)

New commits:
diff-tree 114264584ca43091a5e07282566a30a6378a1502 (from 985611d5cd079f97da700c7b8e898d33da004be0)
Author: Adam Jackson <ajax at theobromine.nwnk.net>
Date:   Fri Jul 21 22:55:41 2006 -0400

    Remove a useless open() of the module we're about to load.

diff --git a/hw/xfree86/loader/dlloader.c b/hw/xfree86/loader/dlloader.c
index 7db04b1..a0e8670 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 b705a18..8ae610f 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 42a9d3c..ddd624c 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -313,7 +313,6 @@ LoaderOpen(const char *module, const cha
 {
     loaderPtr tmp;
     int new_handle;
-    int fd;
 
 #if defined(DEBUG)
     ErrorF("LoaderOpen(%s)\n", module);
@@ -369,16 +368,6 @@ LoaderOpen(const char *module, const cha
     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 cha
     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 cha
 	return -1;
     }
 
-    close(fd);
-
     return new_handle;
 }
 



More information about the xorg-commit mailing list