more portability patches from Albert Chin for HP-UX and AIX Daniel

* xmlIO.c xmlmodule.c: more portability patches from Albert Chin for
  HP-UX and AIX
Daniel
diff --git a/ChangeLog b/ChangeLog
index c3206b5..2660975 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Oct 28 16:53:51 CEST 2005 Daniel Veillard <daniel@veillard.com>
+
+	* xmlIO.c xmlmodule.c: more portability patches from Albert Chin for
+	  HP-UX and AIX
+
 Fri Oct 28 10:36:10 CEST 2005 Daniel Veillard <daniel@veillard.com>
 
 	* xmlmodule.c configure.in: applied 2 patches from Albert Chin for
diff --git a/xmlIO.c b/xmlIO.c
index 1e73b6d..1dffa27 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -610,10 +610,12 @@
  */
 static int
 xmlFdWrite (void * context, const char * buffer, int len) {
-    int ret;
+    int ret = 0;
 
-    ret = write((int) (long) context, &buffer[0], len);
-    if (ret < 0) xmlIOErr(0, "write()");
+    if (len > 0) {
+	ret = write((int) (long) context, &buffer[0], len);
+	if (ret < 0) xmlIOErr(0, "write()");
+    }
     return(ret);
 }
 #endif /* LIBXML_OUTPUT_ENABLED */
diff --git a/xmlmodule.c b/xmlmodule.c
index a26089a..15bcf07 100644
--- a/xmlmodule.c
+++ b/xmlmodule.c
@@ -195,6 +195,10 @@
 #include <dlfcn.h>
 #endif
 
+#ifndef RTLD_GLOBAL            /* For Tru64 UNIX 4.0 */
+#define RTLD_GLOBAL 0
+#endif
+
 /**
  * xmlModulePlatformOpen:
  * @name: path to the module
@@ -277,10 +281,7 @@
     int rc;
 
     errno = 0;
-    rc = shl_findsym(&handle, name, TYPE_PROCEDURE, symbol);
-    if ((-1 == rc) && (0 == errno)) {
-        rc = shl_findsym(handle, name, TYPE_DATA, symbol);
-    }
+    rc = shl_findsym(&handle, name, TYPE_UNDEFINED, symbol);
     return rc;
 }