Commit Graph
9 Commits
Author SHA1 Message Date
Joachim Nilsson 9fc5227343 Update copyright years
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-04-22 14:30:56 +02:00
Joachim Nilsson e613248392 Minor style changes and whitespace fixes
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-04-22 14:30:07 +02:00
Joachim Nilsson ac5f01ea22 Remove Emacs version-control handling
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-04-22 14:29:19 +02:00
Joachim Nilsson b94023faed Reflow paragraphs to match original line breaks, no change in licensing terms!
While comparing the library layout with libite, I noticed how the
formatting of the license paragraphs in all source files had been
garbled.  This patch restores the orginal line breaks.

Note: Only whitespace changes, no change in licensing terms!

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-06-18 01:36:48 +02:00
jakob 361b013da5 O_CLOEXEC does not exist in Debian 6, and apparently EPOLL_CLOEXEC is the correct to use anyway. 2015-06-13 19:32:34 +02:00
Joachim Nilsson 1f9558059a API change -- Remove first ctx argument and add event mask to callback
There really does not exist a good reason for us sending a `uev_ctx_t *`
pointer as the first argument to event callbacks.  If the callback needs
to reference the context, it can find the ctx pointer in the `uev_t *w`.

This patch removes the first argument from all callbacks and also fixes
a slight bug in that the event loop never returned the actual event that
triggered the callback!

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-06-09 13:10:20 +02:00
Joachim Nilsson fe8f3f19da Massively improve error handling, check for EPOLLHUP & EPOLLERR etc.
- Make sure to listen for EPOLLRDHUP in watchers so users can be
  notified when a peer closes a connection.
- Handle EPOLLHUP and EPOLLERR gracefully.  Even handle spurious
  EPOLLHUP by means of an error counter.  If we receive too many errors
  we now restart the epoll fd and re-add all watchers.
- Return error from `epoll_ctl()` in `uev_watcher_stop()`
- Ignore any error from `uev_watcher_stop()` in `uev_watcher_set()`
- Move LIST_REMOVE() et al from io.c to core uev.c, should be
  done for timer and signal callbacks as well, of course.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-03-04 09:41:22 +01:00
Joachim Nilsson 2f8c45f438 Fix TODO: Add uev_*_start() functions.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-02-15 18:13:36 +01:00
Joachim Nilsson 51a802716d Rename main.c --> uev.c
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-02-15 18:13:14 +01:00