Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

Commit

Permalink
usleep fix
Browse files Browse the repository at this point in the history
* test_timer.c used non-existing function uv_usleep
* tuv_unix_port_system.c needs unistd.h for usleep but test_timer.c doesn't anymore

libtuv-DCO-1.0-Signed-off-by: Akos Kiss [email protected]
  • Loading branch information
akosthekiss committed Dec 2, 2015
1 parent 0fc22f0 commit ae24ad8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions source/unix/tuv_unix_port_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

#include <unistd.h> // usleep

#include <uv.h>

#include "uv__unix_platform.h"
Expand Down
3 changes: 1 addition & 2 deletions test/test_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
*/

#include <string.h>
#include <unistd.h> // usleep
#include <uv.h>


Expand Down Expand Up @@ -342,7 +341,7 @@ TEST_IMPL(timer_run_once) {
TUV_ASSERT(0 == uv_timer_start(&timer_handle, timer_run_once_timer_cb, 1, 0));
// slow systems may have nano second resolution
// give some time to sleep so that time tick is changed
uv_usleep(1000);
tuv_usleep(1000);
TUV_ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_ONCE));
TUV_ASSERT(2 == timer_run_once_timer_cb_called);

Expand Down

0 comments on commit ae24ad8

Please sign in to comment.