From af20e1900d15f8cfda66b96bce71b84375b35a4c Mon Sep 17 00:00:00 2001 From: jingham Date: Thu, 10 Feb 2000 08:41:46 +0000 Subject: Don't panic when you can't close an async socket on error. It seems to be benign to just pass out the error, which is a better solution in the long term. --- mac/tclMacSock.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/mac/tclMacSock.c b/mac/tclMacSock.c index ff627ec..f1b1a1c 100644 --- a/mac/tclMacSock.c +++ b/mac/tclMacSock.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacSock.c,v 1.5 1999/08/10 04:21:55 jingham Exp $ + * RCS: @(#) $Id: tclMacSock.c,v 1.6 2000/02/10 08:41:46 jingham Exp $ */ #include "tclInt.h" @@ -760,16 +760,12 @@ TcpClose( closePB.tcpStream = tcpStream; closePB.ioCompletion = NULL; err = PBControlSync((ParmBlkPtr) &closePB); - if (err != noErr) { - panic("error closing async connect socket"); - } - statePtr->flags |= TCP_RELEASE; + if (err == noErr) { + statePtr->flags |= TCP_RELEASE; - InitMacTCPParamBlock(&statePtr->pb, TCPRelease); - statePtr->pb.tcpStream = statePtr->tcpStream; - err = PBControlSync((ParmBlkPtr) &statePtr->pb); - if (err != noErr) { - panic("error releasing async connect socket"); + InitMacTCPParamBlock(&statePtr->pb, TCPRelease); + statePtr->pb.tcpStream = statePtr->tcpStream; + err = PBControlSync((ParmBlkPtr) &statePtr->pb); } /* @@ -779,7 +775,7 @@ TcpClose( ckfree((char *) statePtr->pb.csParam.create.rcvBuff); FreeSocketInfo(statePtr); - return 0; + return err; } /* -- cgit v0.12