Index: trunk/server/source3/lib/os2helper.c
===================================================================
--- trunk/server/source3/lib/os2helper.c	(revision 848)
+++ trunk/server/source3/lib/os2helper.c	(revision 849)
@@ -41,5 +41,4 @@
 #include <string.h>
 #include <sys/socket.h>
-//YD for tmalloc
 #include <malloc.h>
 
@@ -52,6 +51,4 @@
 #define aARCH (1L<<5)		/* 0x20 */
 
-#ifndef TESTING
-
 // Samba DEBUG() needs the following includes and defines
 #include <stdbool.h>
@@ -61,8 +58,4 @@
 #include "../lib/util/xfile.h"
 #include "../lib/util/debug.h"
-#else
-
-#define DEBUG(a,b) (0)
-#endif
 
 #ifndef ENOATTR
@@ -159,27 +152,6 @@
 }
 
-// we search with the exe name if we are in client mode
-/* not needed atm, as done with lp_is_in_client()
-bool os2_isClient()
-{
-	char sExeName [_MAX_PATH];
-	char sDrive [_MAX_PATH], sDir [_MAX_DIR], sName[_MAX_PATH]; 
-
-	if (!os2_GetExeName(sExeName, sizeof(sExeName)))
-		return false;
-
-	// we split to the different values
-	_splitpath(sExeName, sDrive, sDir, sName, NULL);
-	if ( (stricmp(sName, "NDCTL") == 0) || (stricmp(sName, "EVFSCTL") == 0) )
-	{
-		return true;
-	} else  {
-		return false;
-	}
-}
-*/
-
 /* OS/2 specific pipe implementation, we have to use socketpair as select on 
-filehandle is not working. */
+   filehandle is not working. */
 int os2_pipe(int fds[2])
 {
@@ -189,28 +161,8 @@
 	return rc;
 }
-
-#if 0
-// OS/2 specific connect() implementation, as it only works in low mem
-int os2_connect(int fd, const struct sockaddr *address, int address_len)
-{
-        struct sockaddr *addresslow;
-        int rc;
-        addresslow = (struct sockaddr*) _lmalloc(address_len);
-        if (!addresslow)
-                return -1;
-
-        memcpy(addresslow, address, address_len);
-        rc = connect(fd, addresslow, address_len);
-
-        free(addresslow);
-
-        return rc;
-}
-#endif
 
 /* OS/2-specific random functions. these functions used to be based on APR 
    random code, but we discovered some nasty problems with it on fast hardware
    (especially on quadcore) and decided to rewrite it with libc random() */
- 
 void os2_randget(char * buffer, int length)
 {
@@ -339,5 +291,7 @@
 		free(pfea2list);
 	}
-	DEBUG(4,("unigetxattr : (%s:%d) %s %d\n", path ? path : "null", file, name, rc));
+
+	DEBUG(5,("unigetxattr : (%s:%d) %s %d\n", path ? path : "null", file, name, rc));
+
 	return rc;
 }
@@ -373,5 +327,5 @@
 	if (rc)
 	{
-		DEBUG(4,("unilistxattr1 : (%s:%d) %d\n", path ? path : "null", file, rc));
+		DEBUG(4,("unilistxattr1 : (%s:%d) %d\n", path ? npath : "null", file, rc));
 		maperrno(rc);
 		return -1;		
@@ -384,8 +338,8 @@
 	//YD DosEnumAttribute doesn't like high-mem buffers, get a low one.
 	buf = (char *)_tmalloc(stat.cbList * 2);
-	rc = DosEnumAttribute(path ? 1 : 0, path ? (PVOID)path : (PVOID)&file, 1, (PVOID)buf, stat.cbList * 2, &ulCount, 1);
+	rc = DosEnumAttribute(path ? 1 : 0, path ? (PVOID)npath : (PVOID)&file, 1, (PVOID)buf, stat.cbList * 2, &ulCount, 1);
 	if (rc)
 	{
-		DEBUG(4,("unilistxattr2 : (%s:%d) %d\n", path ? path : "null", file, rc));
+		DEBUG(4,("unilistxattr2 : (%s:%d) %d\n", path ? npath : "null", file, rc));
 		maperrno(rc);
 		_tfree(buf);
@@ -408,6 +362,5 @@
 		if (pfea->oNextEntryOffset > 0x10000)
 		{
-			// DEBUG(0, ("Broken Extended Attributes detected for: %s:%d\n", path ? path : "null", file));
-			DEBUG(0, ("Broken Extended Attributes detected for: %s:%d, Last EA:%s\n", path ? path : "null", file, pfea->szName));
+			DEBUG(4, ("Broken Extended Attributes detected for: %s:%d, Last EA:%s\n", path ? path : "null", file, pfea->szName));
 			break;
 		}
@@ -418,5 +371,7 @@
 	}
 	_tfree(buf);
-	DEBUG(4,("unilistxattr : (%s:%d) %d\n", path ? path : "null", file, gotsize));
+
+	DEBUG(5,("unilistxattr : (%s:%d) %d\n", path ? path : "null", file, gotsize));
+
 	if (gotsize > size)
 	{
@@ -492,4 +447,6 @@
 	char * p;
 	
+	DEBUG(5,("unisetxattr : (%s:%d) %s %d\n", path ? path : "null", file, name, size));
+
 	if ((!path && !file) || !name || (!value && size))
 	{
