summaryrefslogtreecommitdiffstats
path: root/src/makepatch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/makepatch.c')
-rw-r--r--src/makepatch.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/makepatch.c b/src/makepatch.c
index 278cd38..3de8860 100644
--- a/src/makepatch.c
+++ b/src/makepatch.c
@@ -40,7 +40,7 @@ static int cb(DB *ddb, struct syrep_name *name, struct diff_entry *de, void *p)
struct syrep_nrecno nrecno;
char path[PATH_MAX+1];
char d[SYREP_DIGESTLENGTH*2+1];
- int f;
+ int f, k;
assert(ddb && name && de && p);
@@ -77,14 +77,16 @@ static int cb(DB *ddb, struct syrep_name *name, struct diff_entry *de, void *p)
snprintf(path, sizeof(path), "%s/%s", cb_info->root, name->path);
- if (!package_get_item(cb_info->c1->package, d, 0)) {
+ if ((k = package_get_item(cb_info->c1->package, d, 0, NULL)) < 0)
+ return -1;
+
+ if (!k) {
if (args.verbose_flag)
fprintf(stderr, "Adding %s (%s) to patch.\n", name->path, d);
if (package_add_file(cb_info->c1->package, d, path) < 0)
return -1;
-
}
return 0;