summaryrefslogtreecommitdiffstats
path: root/src/diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/diff.c b/src/diff.c
index a9a20bd..54185b2 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -182,10 +182,13 @@ static int enumerate(DB *ddb, struct syrep_db_context *c1, struct syrep_db_conte
struct syrep_id *id = (struct syrep_id*) key.data;
struct syrep_meta *meta = (struct syrep_meta*) data.data;
-
-
assert(id && meta);
+ if (interrupted) {
+ fprintf(stderr, "Canceled.\n");
+ goto finish;
+ }
+
if (meta->last_seen != c1->version)
continue;
@@ -344,6 +347,11 @@ int diff_foreach(DB *ddb, int (*cb)(DB *ddb, struct syrep_name *name, struct dif
struct syrep_name *name = (struct syrep_name*) key.data;
struct diff_entry *de = (struct diff_entry*) data.data;
+ if (interrupted) {
+ fprintf(stderr, "Canceled.\n");
+ goto finish;
+ }
+
if ((t = cb(ddb, name, de, p)) < 0) {
r = t;
goto finish;