From 029e36897c3116d30bc8087310c8f7a9ee791be3 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 19 Aug 2004 06:29:14 +0000 Subject: [PATCH] fix compile error --- factor/jedit/FactorWordRenderer.java | 2 +- native/iomux.c | 18 ++++++++---------- native/iomux.h | 2 ++ native/socket.c | 5 ----- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/factor/jedit/FactorWordRenderer.java b/factor/jedit/FactorWordRenderer.java index ed39421dce..59c9f63822 100644 --- a/factor/jedit/FactorWordRenderer.java +++ b/factor/jedit/FactorWordRenderer.java @@ -83,7 +83,7 @@ public class FactorWordRenderer extends DefaultListCellRenderer new String[] { MiscUtilities.charsToEntities(word.name), stackEffect == null - ? 0 : + ? null : MiscUtilities.charsToEntities(stackEffect) })); diff --git a/native/iomux.c b/native/iomux.c index 04ceeba911..55d809eefd 100644 --- a/native/iomux.c +++ b/native/iomux.c @@ -217,29 +217,27 @@ CELL perform_io_tasks(fd_set* fdset, int fd_count, IO_TASK* io_tasks) /* Wait for I/O and return a callback. */ CELL next_io_task(void) { + CELL callback; + int i; + bool reading = set_up_fd_set(&read_fd_set, read_fd_count,read_io_tasks); + bool writing = set_up_fd_set(&write_fd_set, write_fd_count,write_io_tasks); - CELL callback; - - fd_set except_fd_set; - int i; - FD_ZERO(&except_fd_set); - if(!reading && !writing) critical_error("next_io_task() called with no IO tasks",0); select(read_fd_count > write_fd_count ? read_fd_count : write_fd_count, - &read_fd_set,&write_fd_set,&except_fd_set,NULL); - + &read_fd_set,&write_fd_set,NULL,NULL); + for(i = 0; i < 100; i++) { if(FD_ISSET(i,&except_fd_set)) - exit(1); + _exit(1); } - + callback = perform_io_tasks(&read_fd_set,read_fd_count,read_io_tasks); if(callback != F) return callback; diff --git a/native/iomux.h b/native/iomux.h index 17f00c9f3b..6ff52a4483 100644 --- a/native/iomux.h +++ b/native/iomux.h @@ -19,6 +19,8 @@ fd_set write_fd_set; IO_TASK write_io_tasks[FD_SETSIZE]; int write_fd_count; +fd_set except_fd_set; + void init_io_tasks(fd_set* fd_set, IO_TASK* io_tasks); void init_iomux(void); IO_TASK* add_io_task( diff --git a/native/socket.c b/native/socket.c index a9e126057f..2c06f3a403 100644 --- a/native/socket.c +++ b/native/socket.c @@ -99,8 +99,6 @@ CELL accept_connection(PORT* p) struct sockaddr_in clientname; size_t size = sizeof(clientname); - int oobinline = 1; - int new = accept(p->fd,(struct sockaddr *)&clientname,&size); if(new < 0) { @@ -110,9 +108,6 @@ CELL accept_connection(PORT* p) io_error(__FUNCTION__); } - /* if(setsockopt(new,SOL_SOCKET,SO_OOBINLINE,&oobinline,sizeof(int)) < 0) - io_error(__FUNCTION__); */ - p->client_host = tag_object(from_c_string(inet_ntoa( clientname.sin_addr))); p->client_port = tag_fixnum(ntohs(clientname.sin_port));