Merge pull request #380 from Floens/postpone-time-fraction

Support time fractions in lua postpone.
This commit is contained in:
vysheng 2015-01-12 19:00:52 +03:00
commit d434580d23

View File

@ -1391,7 +1391,10 @@ static int postpone_from_lua (lua_State *L) {
t[1] = a2; t[1] = a2;
*(void **)(t + 2) = ev; *(void **)(t + 2) = ev;
struct timeval ts= { timeout, 0}; struct timeval ts= {
.tv_sec = (long)timeout,
.tv_usec = (timeout - ((long)timeout)) * 1000000
};
event_add (ev, &ts); event_add (ev, &ts);
lua_pushboolean (L, 1); lua_pushboolean (L, 1);