ObjFW  Check-in [50641eb716]

Overview
Comment:OFUDPSocket: Fix compiling for HP-UX / Wii / 3DS
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 50641eb716c7c3e57ca49e54ed4edd575af85cc1a9b69c355b912cb899d54f1b
User & Date: js on 2021-10-15 16:15:19
Other Links: manifest | tags
Context
2021-10-15
16:20
Only build tests/objc_sync if we have threads check-in: 23f2312884 user: js tags: trunk
16:15
OFUDPSocket: Fix compiling for HP-UX / Wii / 3DS check-in: 50641eb716 user: js tags: trunk
15:59
Work around buggy string overflow checker in GCC check-in: dcc3e6aab3 user: js tags: trunk
Changes

Modified src/OFUDPSocket.m from [5d65cff83a] to [bb035d1ec6].

90
91
92
93
94
95
96
97

98
99
100
101
102
103
104
105

106
107
108
109
110
111
112
90
91
92
93
94
95
96

97

98

99
100
101
102

103
104
105
106
107
108
109
110







-
+
-

-




-
+








			while (rnd < 1024)
				rnd = (uint16_t)rand();

			OFSocketAddressSetPort(address, rnd);

			if ((ret = bind(_socket, &address->sockaddr.sockaddr,
			    address->length)) == 0) {
			    address->length)) == 0)
				port = rnd;
				break;
			}

			if (OFSocketErrNo() != EADDRINUSE) {
				int errNo = OFSocketErrNo();
				OFString *host = OFSocketAddressString(address);
				uint16_t port = OFSocketAddressPort(port);
				port = OFSocketAddressPort(address);

				closesocket(_socket);
				_socket = OFInvalidSocketHandle;

				@throw [OFBindFailedException
				    exceptionWithHost: host
						 port: port