commit 8a42fca8ab01e340d7099ee3f5988bf7b4c51768 from: Stefan Sperling date: Fri Feb 22 10:39:44 2019 UTC fix trigger_log_thread() would run forever in case the thread had an error commit - 6e73b0d6716c86d47f3eca7813500dd1c7ff7f24 commit + 8a42fca8ab01e340d7099ee3f5988bf7b4c51768 blob - dc9aba73a8c44eab31dea5bbf61c16609c29b090 blob + ea459c1816bc8a91570634707683fbaa538f62a8 --- tog/tog.c +++ tog/tog.c @@ -1250,6 +1250,9 @@ trigger_log_thread(int load_all, int *commits_needed, pthread_cond_t *need_commits) { int errcode; + int max_wait = 20; + + halfdelay(1); /* fast refresh while loading commits */ while (*commits_needed > 0) { if (*log_complete) @@ -1267,14 +1270,13 @@ trigger_log_thread(int load_all, int *commits_needed, if (errcode) return got_error_set_errno(errcode); - if (*commits_needed > 0 && !load_all) { + if (*commits_needed > 0 && (!load_all || --max_wait <= 0)) { /* * Thread is not done yet; lose a key press * and let the user retry... this way the GUI * remains interactive while logging deep paths * with few commits in history. */ - halfdelay(1); /* fast refresh while loading */ return NULL; } }