diff options
| -rw-r--r-- | FIX | 3 | ||||
| -rw-r--r-- | TODO | 1 | ||||
| -rw-r--r-- | src/timeout.c | 5 |
3 files changed, 7 insertions, 2 deletions
| @@ -1 +1,2 @@ | |||
| 1 | filter.chain is coroutine-free | 1 | gettime returns time since Unix Epoch 1/1/1970 (UTC) |
| 2 | sleep is robust to interrupts | ||
| @@ -1,3 +1,4 @@ | |||
| 1 | fix manual for gettime and sleep | ||
| 1 | use wim's filter.chain | 2 | use wim's filter.chain |
| 2 | use mike's "don't set to blocking before closing unless needed" patch? | 3 | use mike's "don't set to blocking before closing unless needed" patch? |
| 3 | take a look at DB's smtp patch (add "extra argument" table) | 4 | take a look at DB's smtp patch (add "extra argument" table) |
diff --git a/src/timeout.c b/src/timeout.c index 152af29..7d55031 100644 --- a/src/timeout.c +++ b/src/timeout.c | |||
| @@ -199,7 +199,10 @@ int tm_lua_sleep(lua_State *L) | |||
| 199 | n -= t.tv_sec; | 199 | n -= t.tv_sec; |
| 200 | t.tv_nsec = (int) (n * 1000000000); | 200 | t.tv_nsec = (int) (n * 1000000000); |
| 201 | if (t.tv_nsec >= 1000000000) t.tv_nsec = 999999999; | 201 | if (t.tv_nsec >= 1000000000) t.tv_nsec = 999999999; |
| 202 | nanosleep(&t, &r); | 202 | while (nanosleep(&t, &r) != 0) { |
| 203 | t.tv_sec = r.tv_sec; | ||
| 204 | t.tv_nsec = r.tv_nsec; | ||
| 205 | } | ||
| 203 | #endif | 206 | #endif |
| 204 | return 0; | 207 | return 0; |
| 205 | } | 208 | } |
