Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 203328
Collapse All | Expand All

(-)libsolve/sockprot.cpp (-3 / +11 lines)
Lines 229-242 Link Here
229
			if (nonblock)
229
			if (nonblock)
230
				return fd;
230
				return fd;
231
231
232
#ifndef WIN32
233
			if (fd >= FD_SETSIZE)
234
			{
235
				close (fd);
236
				errno = EMFILE;
237
			}
238
#endif
239
232
			/* Waits until connection is established */
240
			/* Waits until connection is established */
233
			fd_set s;
241
			fd_set s;
234
			FD_ZERO (&s);
242
			FD_ZERO (&s);
235
			FD_SET (fd, &s);
243
			FD_SET (fd, &s);
236
244
237
			int err = 0;
238
			socklen_t len = sizeof (err);
239
240
			if (select (fd + 1, NULL, &s, NULL, NULL) != 1)
245
			if (select (fd + 1, NULL, &s, NULL, NULL) != 1)
241
			{
246
			{
242
				SetError ();
247
				SetError ();
Lines 248-253 Link Here
248
				continue;
253
				continue;
249
			}
254
			}
250
255
256
			int err = 0;
257
			socklen_t len = sizeof (err);
258
251
			if (getsockopt (fd, SOL_SOCKET, SO_ERROR, &err, &len))
259
			if (getsockopt (fd, SOL_SOCKET, SO_ERROR, &err, &len))
252
			{
260
			{
253
				SetError ();
261
				SetError ();
(-)src/bridge.cpp (+9 lines)
Lines 34-39 Link Here
34
#ifdef HAVE_SYS_SOCKET_H
34
#ifdef HAVE_SYS_SOCKET_H
35
# include <sys/socket.h> // shutdown(), send(), recv()
35
# include <sys/socket.h> // shutdown(), send(), recv()
36
#endif
36
#endif
37
#include <errno.h>
37
38
38
#include "log.h"
39
#include "log.h"
39
40
Lines 115-120 Link Here
115
	long totalcount = 0;
116
	long totalcount = 0;
116
	bridge b[2];
117
	bridge b[2];
117
118
119
#ifndef WIN32
120
	if ((fds[0] >= FD_SETSIZE) || (fds[1] >= FD_SETSIZE))
121
	{
122
		errno = EINVAL;
123
		return -1;
124
	}
125
#endif
126
118
	b[0].outfd = b[1].infd = fds[0];
127
	b[0].outfd = b[1].infd = fds[0];
119
	b[0].infd = b[1].outfd = fds[1];
128
	b[0].infd = b[1].outfd = fds[1];
120
	b[0].buflen = b[1].buflen = 0;
129
	b[0].buflen = b[1].buflen = 0;

Return to bug 203328