src/ioset.h (ioset_update): Declare new function.
src/ioset.c (ioset_init): If we have an engine, return early.
(ioset_add): If no engine, try to initialize.
(ioset_update): New function.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-52
# arch-tag: automatic-ChangeLog--srvx@srvx.net--2006/srvx--devo--1.3
#
+2006-10-04 01:32:57 GMT Michael Poole <mdpoole@troilus.org> patch-52
+
+ Summary:
+ Fix some startup-related glitches.
+ Revision:
+ srvx--devo--1.3--patch-52
+
+ src/ioset.h (ioset_update): Declare new function.
+
+ src/ioset.c (ioset_init): If we have an engine, return early.
+ (ioset_add): If no engine, try to initialize.
+ (ioset_update): New function.
+
+ modified files:
+ ChangeLog src/ioset.c src/ioset.h
+
+
2006-10-04 01:23:10 GMT Michael Poole <mdpoole@troilus.org> patch-51
Summary:
void
ioset_init(void)
{
- assert(engine == NULL);
+ if (engine) /* someone beat us to it */
+ return;
#if WITH_IOSET_KQUEUE
if (!engine && io_engine_kqueue.init())
log_module(MAIN_LOG, LOG_ERROR, "Somebody called ioset_add(%d) on a negative fd!", fd);
return 0;
}
+ if (!engine)
+ ioset_init();
res = calloc(1, sizeof(*res));
if (!res)
return 0;
return io_fd;
}
+void ioset_update(struct io_fd *fd) {
+ engine->update(fd);
+}
+
static void
ioset_try_write(struct io_fd *fd) {
int res;
struct io_fd *ioset_add(int fd);
struct io_fd *ioset_listen(struct sockaddr *local, unsigned int sa_size, void *data, void (*accept_cb)(struct io_fd *listener, struct io_fd *new_connect));
struct io_fd *ioset_connect(struct sockaddr *local, unsigned int sa_size, const char *hostname, unsigned int port, int blocking, void *data, void (*connect_cb)(struct io_fd *fd, int error));
+void ioset_update(struct io_fd *fd);
void ioset_run(void);
void ioset_write(struct io_fd *fd, const char *buf, unsigned int nbw);
int ioset_printf(struct io_fd *fd, const char *fmt, ...) PRINTF_LIKE(2, 3);