Browse Source

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>
maint
Johannes Sixt 10 years ago committed by Junio C Hamano
parent
commit
2024d31765
  1. 1
      cache.h
  2. 2
      help.c
  3. 5
      wrapper.c

1
cache.h

@ -1680,5 +1680,6 @@ int stat_validity_check(struct stat_validity *sv, const char *path);
void stat_validity_update(struct stat_validity *sv, int fd); void stat_validity_update(struct stat_validity *sv, int fd);


int versioncmp(const char *s1, const char *s2); int versioncmp(const char *s1, const char *s2);
void sleep_millisec(int millisec);


#endif /* CACHE_H */ #endif /* CACHE_H */

2
help.c

@ -372,7 +372,7 @@ const char *help_unknown_cmd(const char *cmd)
if (autocorrect > 0) { if (autocorrect > 0) {
fprintf_ln(stderr, _("in %0.1f seconds automatically..."), fprintf_ln(stderr, _("in %0.1f seconds automatically..."),
(float)autocorrect/10.0); (float)autocorrect/10.0);
poll(NULL, 0, autocorrect * 100); sleep_millisec(autocorrect * 100);
} }
return assumed; return assumed;
} }

5
wrapper.c

@ -595,3 +595,8 @@ int write_file(const char *path, int fatal, const char *fmt, ...)
} }
return 0; return 0;
} }

void sleep_millisec(int millisec)
{
poll(NULL, 0, millisec);
}

Loading…
Cancel
Save