[PATCH 4/6] fixup! Add reftable library

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Johannes Schindelin <johannes.schindelin@xxxxxx>

`usleep()` is unportable. We need to find a way _not_ to use it.

For Visual C, we can use `sleep_millisec()`, but the current design of
libreftable seems to be _really_ keen _not_ to depend on anything in
libgit.a.

Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx>
---
 reftable/stack.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/reftable/stack.c b/reftable/stack.c
index 3c5f4a43130..2d0b831dda1 100644
--- a/reftable/stack.c
+++ b/reftable/stack.c
@@ -289,7 +289,12 @@ static int reftable_stack_reload_maybe_reuse(struct reftable_stack *st,
 		free_names(names_after);
 
 		delay = delay + (delay * rand()) / RAND_MAX + 100;
+#ifdef _MSC_VER
+		sleep_millisec(delay/1000);
+#else
+		/* TODO! fix this, `usleep()` is not portable enough for us to use */
 		usleep(delay);
+#endif
 	}
 
 	return 0;
-- 
gitgitgadget




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux