diff --git a/mio/lib/Makefile.am b/mio/lib/Makefile.am index e146b7b..ca655db 100644 --- a/mio/lib/Makefile.am +++ b/mio/lib/Makefile.am @@ -67,9 +67,9 @@ install-data-hook: @echo "#define _MIO_CFG_H_" >> "$(DESTDIR)$(includedir)/mio-cfg.h" @$(EGREP) "#define[ ]+MIO_" "$(abs_builddir)/mio-cfg.h" >> "$(DESTDIR)$(includedir)/mio-cfg.h" @echo "#endif" >> "$(DESTDIR)$(includedir)/mio-cfg.h" - @$(RM) "$(DESTDIR)$(includedir)/mio-cfg.h.in" + @rm -f "$(DESTDIR)$(includedir)/mio-cfg.h.in" @$(SED) 's|/\*#define MIO_HAVE_CFG_H\*/|#define MIO_HAVE_CFG_H|' "$(srcdir)/mio-cmn.h" > "$(DESTDIR)$(includedir)/mio-cmn.h" uninstall-hook: - @$(RM) "$(DESTDIR)$(includedir)/mio-cfg.h" + @rm -f "$(DESTDIR)$(includedir)/mio-cfg.h" diff --git a/mio/lib/Makefile.in b/mio/lib/Makefile.in index eb57cd3..2147223 100644 --- a/mio/lib/Makefile.in +++ b/mio/lib/Makefile.in @@ -997,11 +997,11 @@ install-data-hook: @echo "#define _MIO_CFG_H_" >> "$(DESTDIR)$(includedir)/mio-cfg.h" @$(EGREP) "#define[ ]+MIO_" "$(abs_builddir)/mio-cfg.h" >> "$(DESTDIR)$(includedir)/mio-cfg.h" @echo "#endif" >> "$(DESTDIR)$(includedir)/mio-cfg.h" - @$(RM) "$(DESTDIR)$(includedir)/mio-cfg.h.in" + @rm -f "$(DESTDIR)$(includedir)/mio-cfg.h.in" @$(SED) 's|/\*#define MIO_HAVE_CFG_H\*/|#define MIO_HAVE_CFG_H|' "$(srcdir)/mio-cmn.h" > "$(DESTDIR)$(includedir)/mio-cmn.h" uninstall-hook: - @$(RM) "$(DESTDIR)$(includedir)/mio-cfg.h" + @rm -f "$(DESTDIR)$(includedir)/mio-cfg.h" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/mio/lib/main.c b/mio/lib/main.c index 598db59..c82c10d 100644 --- a/mio/lib/main.c +++ b/mio/lib/main.c @@ -666,7 +666,7 @@ int main (int argc, char* argv[]) } */ - memset (&tcp_make, 0, MIO_SIZEOF(&tcp_make)); + memset (&tcp_make, 0, MIO_SIZEOF(tcp_make)); tcp_make.type = MIO_DEV_SCK_TCP4; tcp_make.on_write = tcp_sck_on_write; tcp_make.on_read = tcp_sck_on_read; @@ -698,7 +698,7 @@ int main (int argc, char* argv[]) } /* -------------------------------------------------------------- */ - memset (&tcp_make, 0, MIO_SIZEOF(&tcp_make)); + memset (&tcp_make, 0, MIO_SIZEOF(tcp_make)); tcp_make.type = MIO_DEV_SCK_TCP4; tcp_make.on_write = tcp_sck_on_write; tcp_make.on_read = tcp_sck_on_read; @@ -733,7 +733,7 @@ int main (int argc, char* argv[]) } /* -------------------------------------------------------------- */ - memset (&tcp_make, 0, MIO_SIZEOF(&tcp_make)); + memset (&tcp_make, 0, MIO_SIZEOF(tcp_make)); tcp_make.type = MIO_DEV_SCK_TCP4; tcp_make.on_write = tcp_sck_on_write; tcp_make.on_read = tcp_sck_on_read; @@ -915,7 +915,7 @@ int main (int argc, char* argv[]) goto oops; } - memset (&tcp_make, 0, MIO_SIZEOF(&tcp_make)); + memset (&tcp_make, 0, MIO_SIZEOF(tcp_make)); tcp_make.type = MIO_DEV_SCK_TCP4; tcp_make.on_write = tcp_sck_on_write; tcp_make.on_read = tcp_sck_on_read; diff --git a/mio/lib/sys-mux.c b/mio/lib/sys-mux.c index 765b800..70b3ea0 100644 --- a/mio/lib/sys-mux.c +++ b/mio/lib/sys-mux.c @@ -64,8 +64,11 @@ int mio_sys_ctrlmux (mio_t* mio, mio_sys_mux_cmd_t cmd, mio_dev_t* dev, int dev_ #if defined(USE_POLL) mio_sys_mux_t* mux = &mio->sysdep->mux; mio_oow_t idx; + mio_syshnd_t hnd; - if (dev->hnd >= mux->map.capa) + hnd = dev->dev_mth->getsyshnd(dev); + + if (hnd >= mux->map.capa) { mio_oow_t new_capa; mio_oow_t* tmp; @@ -220,11 +223,10 @@ int mio_sys_ctrlmux (mio_t* mio, mio_sys_mux_cmd_t cmd, mio_dev_t* dev, int dev_ int mio_sys_waitmux (mio_t* mio, const mio_ntime_t* tmout, mio_sys_mux_evtcb_t event_handler) { #if defined(USE_POLL) - int nentries; + mio_sys_mux_t* mux = &mio->sysdep->mux; + int nentries, i; - mux = (mio_sys_mux_t*)mio->sysdep->mux; - - nentries = poll(mux->pd.pfd, mux->pd.size, MIO_SECNSEC_TO_MSEC(tmout.sec, tmout.nsec)); + nentries = poll(mux->pd.pfd, mux->pd.size, MIO_SECNSEC_TO_MSEC(tmout->sec, tmout->nsec)); if (nentries == -1) { if (errno == EINTR) return 0; @@ -248,7 +250,7 @@ int mio_sys_waitmux (mio_t* mio, const mio_ntime_t* tmout, mio_sys_mux_evtcb_t e if (mux->pd.pfd[i].revents & POLLERR) events |= MIO_DEV_EVENT_ERR; if (mux->pd.pfd[i].revents & POLLHUP) events |= MIO_DEV_EVENT_HUP; - handle_event (dev, events, 0); + event_handler (mio, dev, events, 0); } }