From: Richard Russon Date: Thu, 19 Jul 2018 08:37:17 +0000 (+0100) Subject: usleep is obsolete X-Git-Tag: 2019-10-25~748 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=28c98eb6f098c1841325981a0e0b39044df85f81;p=neomutt usleep is obsolete --- diff --git a/notmuch/mutt_notmuch.c b/notmuch/mutt_notmuch.c index e8a5566d8..fbdc86e1f 100644 --- a/notmuch/mutt_notmuch.c +++ b/notmuch/mutt_notmuch.c @@ -567,6 +567,11 @@ static notmuch_database_t *do_database_open(const char *filename, bool writable, const notmuch_database_mode_t mode = writable ? NOTMUCH_DATABASE_MODE_READ_WRITE : NOTMUCH_DATABASE_MODE_READ_ONLY; + const struct timespec wait = { + .tv_sec = 0, + .tv_nsec = 500000000, /* Half a second */ + }; + do { #if LIBNOTMUCH_CHECK_VERSION(4, 2, 0) @@ -581,7 +586,7 @@ static notmuch_database_t *do_database_open(const char *filename, bool writable, if (verbose && ct && ((ct % 2) == 0)) mutt_error(_("Waiting for notmuch DB... (%d sec)"), ct / 2); - usleep(500000); + nanosleep(&wait, NULL); ct++; } while (true);