From f66183937d3c6f36fc9533ff5777e7c236903747 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Mon, 15 Nov 2021 00:33:25 +0530 Subject: [PATCH] More frequent interrupt handling during du The check is done when traversing directories in preorder i.e before the files inside are enumerated. Postorder traversal is unwinding, so mostly we are done with the calculation and finishing off the thread. --- src/nnn.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/nnn.c b/src/nnn.c index c7440149..952e4e58 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -5486,8 +5486,11 @@ static void *du_thread(void *p_data) FTSENT *node; while ((node = fts_read(tree))) { - if (node->fts_info & FTS_D) + if (node->fts_info & FTS_D) { + if (g_state.interrupt) + break; continue; + } sb = node->fts_statp;