UnixOperatingSystem.st
changeset 16290 d3f266d325ed
parent 16282 a9cd85c4d2f2
child 16301 9eb74aad5c2b
--- a/UnixOperatingSystem.st	Mon Mar 31 11:02:15 2014 +0200
+++ b/UnixOperatingSystem.st	Mon Mar 31 11:22:21 2014 +0200
@@ -11962,88 +11962,88 @@
     type := OperatingSystem socketTypeCodeOf:typeArg.
     proto := self protocolCodeOf:protoArg.
     serviceNameArg notNil ifTrue:[
-	serviceName := serviceNameArg printString.      "convert integer port numbers"
+        serviceName := serviceNameArg printString.      "convert integer port numbers"
     ].
 
     hostName isNil ifTrue:[
-	encodedHostName := nil.
+        encodedHostName := nil.
     ] ifFalse:[
-	encodedHostName := hostName utf8Encoded.
+        encodedHostName := hostName utf8Encoded.
     ].
     (encodedHostName ~~ hostName and:[OperatingSystem getCodeset ~~ #utf8]) ifTrue:[
-	"hostName is not plain ASCII - so this is an IDN domain name. Have to ensure, that the locale is UTF-8.
-	 Block interrupt to not affect othe ST/X processes while the locale is changed."
-	|interruptsBlocked oldLocale|
-
-	interruptsBlocked := OperatingSystem blockInterrupts.
-	oldLocale := OperatingSystem setLocale:#'LC_CTYPE' to:nil.
-	OperatingSystem setLocale:#'LC_CTYPE' to:'en_US.UTF-8'.
-	result := self primGetAddressInfo:encodedHostName serviceName:serviceName domainCode:domain socketTypeCode:type protocolCode:proto flags:flags.
-	OperatingSystem setLocale:#'LC_CTYPE' to:oldLocale.
-	interruptsBlocked ifFalse:[
-	    OperatingSystem unblockInterrupts.
-	].
+        "hostName is not plain ASCII - so this is an IDN domain name. Have to ensure, that the locale is UTF-8.
+         Block interrupt to not affect other ST/X processes while the locale is changed."
+        |interruptsBlocked oldLocale|
+
+        interruptsBlocked := OperatingSystem blockInterrupts.
+        oldLocale := OperatingSystem setLocale:#'LC_CTYPE' to:nil.
+        OperatingSystem setLocale:#'LC_CTYPE' to:'en_US.UTF-8'.
+        result := self primGetAddressInfo:encodedHostName serviceName:serviceName domainCode:domain socketTypeCode:type protocolCode:proto flags:flags.
+        OperatingSystem setLocale:#'LC_CTYPE' to:oldLocale.
+        interruptsBlocked ifFalse:[
+            OperatingSystem unblockInterrupts.
+        ].
     ] ifFalse:[
-	result := self primGetAddressInfo:encodedHostName serviceName:serviceName domainCode:domain socketTypeCode:type protocolCode:proto flags:flags.
+        result := self primGetAddressInfo:encodedHostName serviceName:serviceName domainCode:domain socketTypeCode:type protocolCode:proto flags:flags.
     ].
     result isArray ifFalse:[
-	|request|
-	request := SocketAddressInfo new
-	    domain:domainArg;
-	    type:typeArg;
-	    protocol:protoArg;
-	    canonicalName:hostName;
-	    serviceName:serviceName.
-	^ (HostNameLookupError new
-		parameter:result;
-		messageText:' - ', (result printString);
-		request:request) raiseRequest.
+        |request|
+        request := SocketAddressInfo new
+            domain:domainArg;
+            type:typeArg;
+            protocol:protoArg;
+            canonicalName:hostName;
+            serviceName:serviceName.
+        ^ (HostNameLookupError new
+                parameter:result;
+                messageText:' - ', (result printString);
+                request:request) raiseRequest.
     ].
     1 to:result size do:[:i |
-	|entry dom info|
-
-	entry := result at:i.
-
-	info := SocketAddressInfo new.
-	info
-	    flags:(entry at:1);
-	    domain:(dom := OperatingSystem domainSymbolOf:(entry at:2));
-	    type:(OperatingSystem socketTypeSymbolOf:(entry at:3));
-	    protocol:(self protocolSymbolOf:(entry at:4));
-	    socketAddress:((SocketAddress newDomain:dom) fromBytes:(entry at:5));
-	    canonicalName:(entry at:6).
-
-	result at:i put:info.
+        |entry dom info|
+
+        entry := result at:i.
+
+        info := SocketAddressInfo new.
+        info
+            flags:(entry at:1);
+            domain:(dom := OperatingSystem domainSymbolOf:(entry at:2));
+            type:(OperatingSystem socketTypeSymbolOf:(entry at:3));
+            protocol:(self protocolSymbolOf:(entry at:4));
+            socketAddress:((SocketAddress newDomain:dom) fromBytes:(entry at:5));
+            canonicalName:(entry at:6).
+
+        result at:i put:info.
     ].
     ^ result
 
     "
      self getAddressInfo:'localhost' serviceName:nil
-	    domain:nil type:nil protocol:nil flags:nil
+            domain:nil type:nil protocol:nil flags:nil
      self getAddressInfo:'localhost' serviceName:nil
-	    domain:#inet type:#stream protocol:nil flags:nil
+            domain:#inet type:#stream protocol:nil flags:nil
      self getAddressInfo:'localhost' serviceName:nil
-	    domain:#inet type:#stream protocol:#tcp flags:nil
+            domain:#inet type:#stream protocol:#tcp flags:nil
      self getAddressInfo:'blurb.exept.de' serviceName:nil
-	    domain:#inet type:nil protocol:nil flags:nil
+            domain:#inet type:nil protocol:nil flags:nil
      self getAddressInfo:'1.2.3.4' serviceName:'bla'
-	    domain:#inet type:nil protocol:nil flags:nil
+            domain:#inet type:nil protocol:nil flags:nil
      self getAddressInfo:'localhost' serviceName:'echo'
-	    domain:#inet type:nil protocol:nil flags:nil
+            domain:#inet type:nil protocol:nil flags:nil
      self getAddressInfo:nil serviceName:'echo'
-	    domain:#inet type:nil protocol:nil flags:nil
+            domain:#inet type:nil protocol:nil flags:nil
      self getAddressInfo:nil serviceName:nil
-	    domain:#inet type:nil protocol:nil flags:nil
+            domain:#inet type:nil protocol:nil flags:nil
      self getAddressInfo:'www.google.de' serviceName:nil
-	    domain:nil type:nil protocol:nil flags:nil
+            domain:nil type:nil protocol:nil flags:nil
      self getAddressInfo:'www.exept.de' serviceName:nil
-	    domain:nil type:nil protocol:nil flags:nil
+            domain:nil type:nil protocol:nil flags:nil
      self getAddressInfo:'www.exept.de' serviceName:nil
-	    domain:#'AF_INET' type:nil protocol:nil flags:nil
+            domain:#'AF_INET' type:nil protocol:nil flags:nil
      self getAddressInfo:'www.exept.de' serviceName:nil
-	    domain:#'AF_INET6' type:nil protocol:nil flags:nil
+            domain:#'AF_INET6' type:nil protocol:nil flags:nil
      self getAddressInfo:'www.baden-württemberg.de' serviceName:nil
-	    domain:#'AF_INET' type:#stream protocol:nil flags:nil
+            domain:#'AF_INET' type:#stream protocol:nil flags:nil
     "
 !
 
@@ -13444,11 +13444,11 @@
 !UnixOperatingSystem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.348 2014-03-26 13:02:34 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.349 2014-03-31 09:22:21 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.348 2014-03-26 13:02:34 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.349 2014-03-31 09:22:21 stefan Exp $'
 ! !