Browse code

- -mallign-double removed (incompatible with kqueue on netbst and with epoll on linux 2.6.* => it has big problem causing potential for almost no benefit) - sigio_rt mostly cosmetic changes

Andrei Pelinescu-Onciul authored on 12/09/2005 17:08:07
Showing 3 changed files
... ...
@@ -43,6 +43,7 @@
43 43
 #  2005-07-04  HAVE_DEVPOLL added to solaris (andrei)
44 44
 #  2005-07-06  gcc 4.0 optimizations support (andrei)
45 45
 #  2005-07-25  better solaris arch detection (andrei)
46
+#  2005-09-12  -mallign-double removed (too many problems) (andrei)
46 47
 
47 48
 
48 49
 # check if already included/exported
... ...
@@ -59,7 +60,7 @@ MAIN_NAME=ser
59 60
 VERSION = 0
60 61
 PATCHLEVEL = 10
61 62
 SUBLEVEL =   99
62
-EXTRAVERSION = -dev17-tcp
63
+EXTRAVERSION = -dev18-tcp
63 64
 
64 65
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
65 66
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
... ...
@@ -489,7 +490,7 @@ ifeq		($(CC_NAME), gcc)
489 490
 			#if gcc 4.0+
490 491
 ifeq			($(CC_SHORTVER), 4.x)
491 492
 					CPU ?= athlon64
492
-					CFLAGS+=-minline-all-stringops -malign-double \
493
+					CFLAGS+=-minline-all-stringops \
493 494
 							-falign-loops \
494 495
 							-ftree-vectorize \
495 496
 							-mtune=$(CPU) 
... ...
@@ -497,14 +498,14 @@ else
497 498
 			#if gcc 3.4+
498 499
 ifeq			($(CC_SHORTVER), 3.4)
499 500
 					CPU ?= athlon
500
-					CFLAGS+=-minline-all-stringops -malign-double \
501
+					CFLAGS+=-minline-all-stringops \
501 502
 							-falign-loops \
502 503
 							-mtune=$(CPU) 
503 504
 else
504 505
 			#if gcc 3.0+
505 506
 ifeq			($(CC_SHORTVER), 3.0)
506 507
 					CPU ?= athlon
507
-					CFLAGS+=-minline-all-stringops -malign-double \
508
+					CFLAGS+=-minline-all-stringops \
508 509
 							-falign-loops \
509 510
 							-mcpu=$(CPU) 
510 511
 else
... ...
@@ -1005,6 +1006,8 @@ ifeq ($(OS), linux)
1005 1006
 	ifeq ($(shell [ $(OSREL_N) -ge 2005044 ] && echo has_epoll), has_epoll)
1006 1007
 		ifeq ($(NO_EPOLL),)
1007 1008
 			DEFS+=-DHAVE_EPOLL
1009
+			# linux + gcc >= 3.0 + -malign-double + epoll => problems
1010
+			CFLAGS:=$(filter-out -malign-double, $(CFLAGS))
1008 1011
 		endif
1009 1012
 	endif
1010 1013
 	# check for >= 2.2.0
... ...
@@ -538,7 +538,7 @@ inline static int io_watch_del(io_wait_h* h, int fd, int idx, int flags)
538 538
 			/* the O_ASYNC flag must be reset all the time, the fd
539 539
 			 *  can be changed only if  O_ASYNC is reset (if not and
540 540
 			 *  the fd is a duplicate, you will get signals from the dup. fd
541
-			 *  and not from the original, even if the dup. fd wa closed
541
+			 *  and not from the original, even if the dup. fd was closed
542 542
 			 *  and the signals re-set on the original) -- andrei
543 543
 			 */
544 544
 			/*if (!(flags & IO_FD_CLOSING)){*/
... ...
@@ -868,7 +868,8 @@ again:
868 868
 					handle_io(fm, -1);
869 869
 				else
870 870
 					LOG(L_ERR, "WARNING: io_wait_loop_sigio_rt: ignoring event"
871
-							"%x on fd %d\n", sigio_band, sigio_fd);
871
+							" %x on fd %d (fm->fd=%d, fm->data=%p)\n",
872
+							sigio_band, sigio_fd, fm->fd, fm->data);
872 873
 			}else{
873 874
 				LOG(L_ERR, "ERROR: io_wait_loop_sigio_rt: unexpected event"
874 875
 							" on fd %d: %x\n", sigio_fd, sigio_band);
... ...
@@ -223,7 +223,9 @@ static int tcp_blocking_connect(int fd, const struct sockaddr *servaddr,
223 223
 	int ticks;
224 224
 	int err;
225 225
 	unsigned int err_len;
226
+	int poll_err;
226 227
 	
228
+	poll_err=0;
227 229
 	to=tcp_connect_timeout;
228 230
 	ticks=get_ticks();
229 231
 again:
... ...
@@ -270,17 +272,18 @@ again:
270 272
 			goto error;
271 273
 		}else if (n==0) /* timeout */ continue;
272 274
 #if defined(HAVE_SELECT) && defined(BLOCKING_USE_SELECT)
273
-		if (FD_ISSET(fd, &sel_set)){
275
+		if (FD_ISSET(fd, &sel_set))
274 276
 #else
275 277
 		if (pf.revents&(POLLERR|POLLHUP|POLLNVAL)){ 
276
-			LOG(L_ERR, "ERROR: tcp_blocking_connect: bad poll flags %x\n",
278
+			LOG(L_ERR, "ERROR: tcp_blocking_connect: poll error: flags %x\n",
277 279
 					pf.revents);
278
-			goto error;
279
-		}else{
280
+			poll_err=1;
281
+		}
280 282
 #endif
283
+		{
281 284
 			err_len=sizeof(err);
282 285
 			getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &err_len);
283
-			if (err==0) goto end;
286
+			if ((err==0) && (poll_err==0)) goto end;
284 287
 			if (err!=EINPROGRESS && err!=EALREADY){
285 288
 				LOG(L_ERR, "ERROR: tcp_blocking_connect: SO_ERROR (%d) %s\n",
286 289
 						err, strerror(err));