help.c: wrap wait-only poll() invocation in sleep_millisec()

We want to use the new function elsewhere in a moment. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Sixt committed Jun 5, 2015 at 21:45 UTC 2024d3176536fd437b4c0a744161e96bc150a24e
3 files changed +7 -1
cache.h
+1
@@ -1680,5 +1680,6 @@ int stat_validity_check(struct stat_validity *sv, const char *path);
1680 void stat_validity_update(struct stat_validity *sv, int fd);
1681
1682 int versioncmp(const char *s1, const char *s2);
1683 +void sleep_millisec(int millisec);
1684
1685 #endif /* CACHE_H */
help.c
+1 -1
@@ -372,7 +372,7 @@ const char *help_unknown_cmd(const char *cmd)
372 if (autocorrect > 0) {
373 fprintf_ln(stderr, _("in %0.1f seconds automatically..."),
374 (float)autocorrect/10.0);
375 - poll(NULL, 0, autocorrect * 100);
375 + sleep_millisec(autocorrect * 100);
376 }
377 return assumed;
378 }
wrapper.c
+5
@@ -595,3 +595,8 @@ int write_file(const char *path, int fatal, const char *fmt, ...)
595 }
596 return 0;
597 }
598 +
599 +void sleep_millisec(int millisec)
600 +{
601 + poll(NULL, 0, millisec);
602 +}