Commit Graph
3 Commits
Author SHA1 Message Date
omrzk e699cb7f5f Honor UEV_ONCE when stdin is redirected from a file
With stdin redirected from a regular file, uev_run() with UEV_ONCE does
not return until end of file:

    app < file.txt

The workaround for regular files, which epoll cannot watch, restarts
the loop before the UEV_ONCE check.

Check the flag there too.

Closes #37
2026-11-16 14:54:47 +01:00
omrzk fbe2c15377 Honor new descriptor and events in uev_io_set()
uev_io_set() on an active oneshot watcher keeps watching the old
descriptor, for the old events:

    uev_io_set(w, newfd, UEV_READ | UEV_ONESHOT);

It only rearms the watcher, with what is already stored in it.

Rearm only when neither has changed, otherwise stop the watcher and set
it up again.

Closes #35
2026-11-16 14:54:46 +01:00
Joachim Wiberg caa62910db Relocate tests/ -> test/
For my own sanity, test/ is used in every other project of mine.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-08-01 22:40:35 +02:00