mirror of
https://github.com/troglobit/libuev.git
synced 2026-10-20 10:59:31 +00:00
Fix TODO: Add uev_*_start() functions.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
bfcea55b1e
commit
2f8c45f438
6 files changed
+73
-8
No files matched your search
@@ -130,6 +130,25 @@ int uev_timer_set(uev_t *w, int timeout, int period)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start a stopped timer watcher
|
||||
* @param w Watcher to start (again)
|
||||
*
|
||||
* @return POSIX OK(0) or non-zero with @param errno set on error.
|
||||
*/
|
||||
int uev_timer_start(uev_t *w)
|
||||
{
|
||||
if (!w) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (-1 != w->fd)
|
||||
uev_watcher_stop(w);
|
||||
|
||||
return uev_timer_set(w, w->timeout, w->period);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop and unregister a timer watcher
|
||||
* @param w Watcher to stop
|
||||
|
||||
Reference in new issue
Block a user