lib/deltas: Check cancellable during processing
authorColin Walters <walters@verbum.org>
Thu, 12 Oct 2017 14:46:25 +0000 (10:46 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 12 Oct 2017 15:04:02 +0000 (15:04 +0000)
Let's react to `Ctrl-C` faster here. Noticed while I was doing an update on my
desktop and playing with cancellation.

Closes: #1266
Approved by: jlebon

src/libostree/ostree-repo-static-delta-processing.c

index 6d00e79f4841b158414f0d8b16f05df340f8c181..84fed6824f5437de0a76ae969af7ff3a21a59d45 100644 (file)
@@ -229,6 +229,9 @@ _ostree_static_delta_part_execute (OstreeRepo      *repo,
       state->oplen--;
       state->opdata++;
 
+      if (g_cancellable_set_error_if_cancelled (cancellable, error))
+        goto out;
+
       switch (opcode)
         {
         case OSTREE_STATIC_DELTA_OP_OPEN_SPLICE_AND_CLOSE: