Win32OperatingSystem.st
branchjv
changeset 18079 7b5afc0ad3d5
parent 18078 7ef3221b036d
parent 15580 4f1aa9df6162
child 18080 9ae1db7ef04a
--- a/Win32OperatingSystem.st	Thu Jul 25 13:04:52 2013 +0100
+++ b/Win32OperatingSystem.st	Thu Aug 01 10:22:20 2013 +0100
@@ -824,6 +824,7 @@
     "Modified: 7.1.1997 / 19:36:11 / stefan"
 ! !
 
+
 !Win32OperatingSystem class methodsFor:'OS signal constants'!
 
 sigABRT
@@ -15751,7 +15752,9 @@
     __AT_PUT_(symbTable , @symbol(SHAREADMIN),   __MKUINT( RESOURCEDISPLAYTYPE_SHAREADMIN ) );
     __AT_PUT_(symbTable , @symbol(DIRECTORY),    __MKUINT( RESOURCEDISPLAYTYPE_DIRECTORY ) );
     __AT_PUT_(symbTable , @symbol(TREE),         __MKUINT( RESOURCEDISPLAYTYPE_TREE ) );
+#ifdef RESOURCEDISPLAYTYPE_NDSCONTAINER
     __AT_PUT_(symbTable , @symbol(NDSCONTAINER), __MKUINT( RESOURCEDISPLAYTYPE_NDSCONTAINER ) );
+#endif
 %}.
     DisplayTypeMappingTable := Dictionary new.
 
@@ -16779,13 +16782,15 @@
 %{ /* STACK:32000 */
 #if !defined(NO_SOCKET)
     char *__hostName, *__serviceName;
+    char __hostNameCopy[1024], __serviceNameCopy[256];
     int ret;
     int cnt = 0;
 
     if (hostName == nil) {
 	__hostName = 0;
     } else if (__isStringLike(hostName)) {
-	__hostName = __stringVal(hostName);
+	strncpy(__hostNameCopy, __stringVal(hostName), sizeof(__hostNameCopy)-1);
+	__hostName = __hostNameCopy;
     } else {
 	error = @symbol(badArgument1);
 	goto exitPrim;
@@ -16793,7 +16798,8 @@
     if (serviceName == nil) {
 	__serviceName = 0;
     } else if (__isStringLike(serviceName)) {
-	__serviceName = __stringVal(serviceName);
+	strncpy(__serviceNameCopy, __stringVal(serviceName), sizeof(__serviceNameCopy)-1);
+	__serviceName = __serviceNameCopy;
     } else {
 	error = @symbol(badArgument2);
 	goto exitPrim;
@@ -16808,6 +16814,7 @@
     /*
      * Use getaddrinfo()
      */
+    extern getaddrinfo();
     struct addrinfo hints;
     struct addrinfo *info = NULL, *infop;
 
@@ -16820,18 +16827,6 @@
 	hints.ai_protocol = __intVal(proto);
 
     do {
-	/* must refetch in loop */
-	if (hostName == nil) {
-	    __hostName = 0;
-	} else if (__isStringLike(hostName)) {
-	    __hostName = __stringVal(hostName);
-	}
-	if (serviceName == nil) {
-	    __serviceName = 0;
-	} else if (__isStringLike(serviceName)) {
-	    __serviceName = __stringVal(serviceName);
-	}
-
 # ifdef DO_WRAP_CALLS
 	do {
 	    __threadErrno = 0;
@@ -16960,12 +16955,6 @@
     if (__hostName) {
 #  ifdef USE_H_ERRNO
 	do {
-	    /* must refetch in loop */
-	    if (hostName == nil) {
-		__hostName = 0;
-	    } else if (__isStringLike(hostName)) {
-		__hostName = __stringVal(hostName);
-	    }
 # ifdef DO_WRAP_CALLS
 	    hp = STX_WSA_NOINT_CALL1("gethostbyname", gethostbyname, __hostName);
 	    if ((INT)hp < 0) hp = NULL;
@@ -17203,6 +17192,7 @@
     }
 
     {
+	extern getnameinfo();
 	bp = (char *)(__byteArrayVal(socketAddress));
 	bp += nInstBytes;
 # ifdef DO_WRAP_CALLS
@@ -17430,15 +17420,15 @@
 !Win32OperatingSystem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.475 2013-07-24 22:03:42 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.476 2013-07-30 16:34:20 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.475 2013-07-24 22:03:42 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.476 2013-07-30 16:34:20 stefan Exp $'
 !
 
 version_SVN
-    ^ '$Id: Win32OperatingSystem.st,v 1.475 2013-07-24 22:03:42 cg Exp $'
+    ^ '$Id: Win32OperatingSystem.st,v 1.476 2013-07-30 16:34:20 stefan Exp $'
 
 ! !