ObjFW  Diff

Differences From Artifact [5936ea8b18]:

To Artifact [e69a794cf2]:


99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
}

- (BOOL)observeWithTimeout: (double)timeout
{
	void *pool = objc_autoreleasePoolPush();
	struct timespec timespec;
	struct kevent eventList[EVENTLIST_SIZE];
	int i, events;

	timespec.tv_sec = timeout;
	timespec.tv_nsec = (timeout - timespec.tv_sec) * 1000000000;

	[self _processQueue];

	if ([self _processCache]) {







|







99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
}

- (BOOL)observeWithTimeout: (double)timeout
{
	void *pool = objc_autoreleasePoolPush();
	struct timespec timespec;
	struct kevent eventList[EVENTLIST_SIZE];
	int i, events, realEvents = 0;

	timespec.tv_sec = timeout;
	timespec.tv_nsec = (timeout - timespec.tv_sec) * 1000000000;

	[self _processQueue];

	if ([self _processCache]) {
142
143
144
145
146
147
148


149
150
151
152
153
154
155
		if (eventList[i].ident == cancelFD[0]) {
			char buffer;

			OF_ENSURE(read(cancelFD[0], &buffer, 1) > 0);

			continue;
		}



		pool = objc_autoreleasePoolPush();

		if (eventList[i].flags & EV_ERROR) {
			[delegate streamDidReceiveException:
			    FDToStream[eventList[i].ident]];
			objc_autoreleasePoolPop(pool);







>
>







142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
		if (eventList[i].ident == cancelFD[0]) {
			char buffer;

			OF_ENSURE(read(cancelFD[0], &buffer, 1) > 0);

			continue;
		}

		realEvents++;

		pool = objc_autoreleasePoolPush();

		if (eventList[i].flags & EV_ERROR) {
			[delegate streamDidReceiveException:
			    FDToStream[eventList[i].ident]];
			objc_autoreleasePoolPop(pool);
167
168
169
170
171
172
173



174
175
176
177
			break;
		default:
			assert(0);
		}

		objc_autoreleasePoolPop(pool);
	}




	return YES;
}
@end







>
>
>




169
170
171
172
173
174
175
176
177
178
179
180
181
182
			break;
		default:
			assert(0);
		}

		objc_autoreleasePoolPop(pool);
	}

	if (realEvents == 0)
		return NO;

	return YES;
}
@end