Tcl Source Code

Check-in [29b76e5d7d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Eliminate some redundant Tcl_GetErrno() calls.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 29b76e5d7dfd7ca2f38b6437fa8fb680edd04efa
User & Date: jan.nijtmans 2013-11-18 11:00:51
Context
2013-11-18
13:32
Revert [3c0b0bbda6]. If this really is a problem, it needs to get fixed by other means than covering... check-in: c1c1d9ee69 user: max tags: trunk
12:35
To prepare for completion of the [socket -async] implementation on Windows [13d3af3ad5]:
  • Move ...
check-in: 09ba8482cc user: max tags: bug-13d3af3ad5
11:00
Eliminate some redundant Tcl_GetErrno() calls. check-in: 29b76e5d7d user: jan.nijtmans tags: trunk
2013-11-16
21:06
Fix [e832d2b08]: unnecessary code in Tcl_SetMaxBlockTime. check-in: 04b08d7303 user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclIOGT.c.

657
658
659
660
661
662
663

664
665
666
667
668
669
670
671
672
673
674
675
676
	read = Tcl_ReadRaw(downChan, buf, toRead);
	if (read < 0) {
	    /*
	     * Report errors to caller. EAGAIN is a special situation. If we
	     * had some data before we report that instead of the request to
	     * re-try.
	     */


	    if ((Tcl_GetErrno() == EAGAIN) && (gotBytes > 0)) {
		return gotBytes;
	    }

	    *errorCodePtr = Tcl_GetErrno();
	    return -1;
	} else if (read == 0) {
	    /*
	     * Check wether we hit on EOF in the underlying channel or not. If
	     * not differentiate between blocking and non-blocking modes. In
	     * non-blocking mode we ran temporarily out of data. Signal this
	     * to the caller via EWOULDBLOCK and error return (-1). In the







>

|



|







657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
	read = Tcl_ReadRaw(downChan, buf, toRead);
	if (read < 0) {
	    /*
	     * Report errors to caller. EAGAIN is a special situation. If we
	     * had some data before we report that instead of the request to
	     * re-try.
	     */
		int error = Tcl_GetErrno();

	    if ((error == EAGAIN) && (gotBytes > 0)) {
		return gotBytes;
	    }

	    *errorCodePtr = error;
	    return -1;
	} else if (read == 0) {
	    /*
	     * Check wether we hit on EOF in the underlying channel or not. If
	     * not differentiate between blocking and non-blocking modes. In
	     * non-blocking mode we ran temporarily out of data. Signal this
	     * to the caller via EWOULDBLOCK and error return (-1). In the

Changes to win/tclWinSock.c.

1313
1314
1315
1316
1317
1318
1319
1320
1321

1322
1323
1324
1325
1326
1327
1328

		/*
		 * Attempt to connect to the remote socket.
		 */

		if (connect(sock, addrPtr->ai_addr, addrPtr->ai_addrlen)
			== SOCKET_ERROR) {
		    TclWinConvertError((DWORD) WSAGetLastError());
		    if (Tcl_GetErrno() != EWOULDBLOCK) {

			goto looperror;
		    }

		    /*
		     * The connection is progressing in the background.
		     */








|
|
>







1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329

		/*
		 * Attempt to connect to the remote socket.
		 */

		if (connect(sock, addrPtr->ai_addr, addrPtr->ai_addrlen)
			== SOCKET_ERROR) {
		    DWORD error = (DWORD) WSAGetLastError();
		    if (error != WSAEWOULDBLOCK) {
			TclWinConvertError(error);
			goto looperror;
		    }

		    /*
		     * The connection is progressing in the background.
		     */