*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Tue, 12 Mar 2019 22:06:09 +0100
changeset 23879 363bed19a5fa
parent 23878 a08a25c24390
child 23880 f366fd5a51b5
*** empty log message ***
ExternalStream.st
--- a/ExternalStream.st	Tue Mar 12 22:05:44 2019 +0100
+++ b/ExternalStream.st	Tue Mar 12 22:06:09 2019 +0100
@@ -2398,13 +2398,13 @@
      No error if the stream is not open."
 
     self isOpen ifTrue:[
-        self unregisterForFinalization.
-        self isOpen ifTrue:[
-            self closeFile.
-            dependents notNil ifTrue:[
-                self changed:#close.
-            ].    
-        ].
+	self unregisterForFinalization.
+	self isOpen ifTrue:[
+	    self closeFile.
+	    dependents notNil ifTrue:[
+		self changed:#close.
+	    ].
+	].
     ].
 
     "Modified: / 19-02-2019 / 16:08:51 / Claus Gittinger"
@@ -4941,12 +4941,13 @@
     if (__INST(handleType) == @symbol(socketHandle)) {
 	SOCKET sock = (SOCKET)(__FILEVal(fp));
 
+	// whether the close() will be successful or not - the handle is invalid now!
+	__INST(handle) = nil;
+
 	if (@global(FileOpenTrace) == true) {
 	    fprintf(stderr, "close socket [ExternalStream] %"_lx_"\n", (INT)sock);
 	}
 
-	// whether the close() will be successful or not - the handle is invalid now!
-	__INST(handle) = nil;
 	do {
 #ifdef __win32__
 	    rslt = __STX_WSA_NOINT_CALL1("closesocket", closesocket, sock);
@@ -4964,6 +4965,9 @@
     {
 	FILEPOINTER f = __FILEVal(fp);
 
+	// whether the close() will be successful or not - the handle is invalid now!
+	__INST(handle) = nil;
+
 	if (@global(FileOpenTrace) == true) {
 	    fprintf(stderr, "fclose [ExternalStream] %"_lx_"\n", (INT)f);
 	}
@@ -4979,8 +4983,6 @@
 	    if (rslt < 0)
 		goto err;
 	}
-	// whether the close() will be successful or not - the handle is invalid now!
-	__INST(handle) = nil;
 	do {
 	    __threadErrno = 0;
 	    rslt = __STX_C_NOINT_CALL1("fclose", fclose, f);
@@ -5001,8 +5003,6 @@
 	    if (rslt < 0)
 		goto err;
 	}
-	// whether the close() will be successful or not - the handle is invalid now!
-	__INST(handle) = nil;
 	do {
 	    clearerr(f);
 	    __threadErrno = 0;