ObjFW  Check-in [91131d6d7d]

Overview
Comment:Fix setCanBlock: being inverted on Windows/AmigaOS
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 91131d6d7d1105d1281baf05ff64075dbeb540d0a5ac7be9fb3bf216d226ede3
User & Date: js on 2021-05-08 19:30:17
Other Links: manifest | tags
Context
2021-05-08
20:07
Treat EWOULDBLOCK equal to EINPROGRESS on Windows check-in: f3ca0f6a2c user: js tags: trunk
19:30
Fix setCanBlock: being inverted on Windows/AmigaOS check-in: 91131d6d7d user: js tags: trunk
2021-05-02
22:24
Include major version in Amiga .library name check-in: e1bc874652 user: js tags: trunk
Changes

Modified src/OFDatagramSocket.m from [d32466923e] to [a53bf3d04b].

114
115
116
117
118
119
120
121

122
123
124
125
126
127
128
114
115
116
117
118
119
120

121
122
123
124
125
126
127
128







-
+








	if (fcntl(_socket, F_SETFL, flags) == -1)
		@throw [OFSetOptionFailedException exceptionWithObject: self
								 errNo: errno];

	_canBlock = canBlock;
#elif defined(OF_WINDOWS)
	u_long v = canBlock;
	u_long v = !canBlock;

	if (ioctlsocket(_socket, FIONBIO, &v) == SOCKET_ERROR)
		@throw [OFSetOptionFailedException
		    exceptionWithObject: self
				  errNo: OFSocketErrNo()];

	_canBlock = canBlock;

Modified src/OFSequencedPacketSocket.m from [7bcba89d06] to [d397c2379d].

131
132
133
134
135
136
137
138

139
140
141
142
143
144
145
131
132
133
134
135
136
137

138
139
140
141
142
143
144
145







-
+








	if (fcntl(_socket, F_SETFL, flags) == -1)
		@throw [OFSetOptionFailedException exceptionWithObject: self
								 errNo: errno];

	_canBlock = canBlock;
#elif defined(OF_WINDOWS)
	u_long v = canBlock;
	u_long v = !canBlock;

	if (ioctlsocket(_socket, FIONBIO, &v) == SOCKET_ERROR)
		@throw [OFSetOptionFailedException
		    exceptionWithObject: self
				  errNo: OFSocketErrNo()];

	_canBlock = canBlock;

Modified src/OFStreamSocket.m from [a955b9500f] to [5b9cb9181f].

160
161
162
163
164
165
166
167

168
169

170
171
172
173
174
175
176
160
161
162
163
164
165
166

167
168

169
170
171
172
173
174
175
176







-
+

-
+







	return (size_t)bytesWritten;
}

#if defined(OF_WINDOWS) || defined(OF_AMIGAOS)
- (void)setCanBlock: (bool)canBlock
{
# ifdef OF_WINDOWS
	u_long v = canBlock;
	u_long v = !canBlock;
# else
	char v = canBlock;
	char v = !canBlock;
# endif

	if (ioctlsocket(_socket, FIONBIO, &v) == SOCKET_ERROR)
		@throw [OFSetOptionFailedException
		    exceptionWithObject: self
				  errNo: OFSocketErrNo()];