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 59
 VERSION = 0
60 60
 PATCHLEVEL = 10
61 61
 SUBLEVEL =   99
62
-EXTRAVERSION = -dev17-tcp
62
+EXTRAVERSION = -dev18-tcp
63 63
 
64 64
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
65 65
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
... ...
@@ -489,7 +490,7 @@ ifeq		($(CC_NAME), gcc)
489 489
 			#if gcc 4.0+
490 490
 ifeq			($(CC_SHORTVER), 4.x)
491 491
 					CPU ?= athlon64
492
-					CFLAGS+=-minline-all-stringops -malign-double \
492
+					CFLAGS+=-minline-all-stringops \
493 493
 							-falign-loops \
494 494
 							-ftree-vectorize \
495 495
 							-mtune=$(CPU) 
... ...
@@ -497,14 +498,14 @@ else
497 497
 			#if gcc 3.4+
498 498
 ifeq			($(CC_SHORTVER), 3.4)
499 499
 					CPU ?= athlon
500
-					CFLAGS+=-minline-all-stringops -malign-double \
500
+					CFLAGS+=-minline-all-stringops \
501 501
 							-falign-loops \
502 502
 							-mtune=$(CPU) 
503 503
 else
504 504
 			#if gcc 3.0+
505 505
 ifeq			($(CC_SHORTVER), 3.0)
506 506
 					CPU ?= athlon
507
-					CFLAGS+=-minline-all-stringops -malign-double \
507
+					CFLAGS+=-minline-all-stringops \
508 508
 							-falign-loops \
509 509
 							-mcpu=$(CPU) 
510 510
 else
... ...
@@ -1005,6 +1006,8 @@ ifeq ($(OS), linux)
1005 1005
 	ifeq ($(shell [ $(OSREL_N) -ge 2005044 ] && echo has_epoll), has_epoll)
1006 1006
 		ifeq ($(NO_EPOLL),)
1007 1007
 			DEFS+=-DHAVE_EPOLL
1008
+			# linux + gcc >= 3.0 + -malign-double + epoll => problems
1009
+			CFLAGS:=$(filter-out -malign-double, $(CFLAGS))
1008 1010
 		endif
1009 1011
 	endif
1010 1012
 	# 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 270
 			goto error;
271 271
 		}else if (n==0) /* timeout */ continue;
272 272
 #if defined(HAVE_SELECT) && defined(BLOCKING_USE_SELECT)
273
-		if (FD_ISSET(fd, &sel_set)){
273
+		if (FD_ISSET(fd, &sel_set))
274 274
 #else
275 275
 		if (pf.revents&(POLLERR|POLLHUP|POLLNVAL)){ 
276
-			LOG(L_ERR, "ERROR: tcp_blocking_connect: bad poll flags %x\n",
276
+			LOG(L_ERR, "ERROR: tcp_blocking_connect: poll error: flags %x\n",
277 277
 					pf.revents);
278
-			goto error;
279
-		}else{
278
+			poll_err=1;
279
+		}
280 280
 #endif
281
+		{
281 282
 			err_len=sizeof(err);
282 283
 			getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &err_len);
283
-			if (err==0) goto end;
284
+			if ((err==0) && (poll_err==0)) goto end;
284 285
 			if (err!=EINPROGRESS && err!=EALREADY){
285 286
 				LOG(L_ERR, "ERROR: tcp_blocking_connect: SO_ERROR (%d) %s\n",
286 287
 						err, strerror(err));