]> Sergey Matveev's repositories - nnn.git/commitdiff
More frequent interrupt handling during du
authorArun Prakash Jana <engineerarun@gmail.com>
Sun, 14 Nov 2021 19:03:25 +0000 (00:33 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sun, 14 Nov 2021 19:41:46 +0000 (01:11 +0530)
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

index c7440149412d263e1e491835eef5545caf3f522c..952e4e58f2d58d004d3a399af7b1ea55a2f94f5b 100644 (file)
--- 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;