You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
391 B

  1. --- a/examples/nonblocking.c
  2. +++ b/examples/nonblocking.c
  3. @@ -70,8 +70,10 @@ int main()
  4. if (ret == SHOUTERR_BUSY)
  5. printf("Connection pending...\n");
  6. + const struct timespec req = {0, 10 * 1000 * 1000};
  7. + struct timespec rem;
  8. while (ret == SHOUTERR_BUSY) {
  9. - usleep(10000);
  10. + nanosleep(&req, &rem);
  11. ret = shout_get_connected(shout);
  12. }