summaryrefslogtreecommitdiff
path: root/src/basic/bitmap.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2016-06-24 01:26:25 +0200
committerGitHub <noreply@github.com>2016-06-24 01:26:25 +0200
commita2c28c645160b4e9377db4cb40cb9f22141f2dd3 (patch)
tree9fbb81747c4d973edec60ab967b0eb818ebbc219 /src/basic/bitmap.c
parentde2edc008a612e152f0690d5063d53001c4e13ff (diff)
parent4e68ec18669db7175a999f95b6b5b0d1908376c9 (diff)
Merge pull request #3549 from poettering/resolved-more
resolved: more fixes, among them "systemctl-resolve --status" to see DNS configuration in effect, and a local DNS stub listener on 127.0.0.53
Diffstat (limited to 'src/basic/bitmap.c')
-rw-r--r--src/basic/bitmap.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/basic/bitmap.c b/src/basic/bitmap.c
index ad1fda0198..f4b12fc261 100644
--- a/src/basic/bitmap.c
+++ b/src/basic/bitmap.c
@@ -50,6 +50,23 @@ Bitmap *bitmap_new(void) {
return new0(Bitmap, 1);
}
+Bitmap *bitmap_copy(Bitmap *b) {
+ Bitmap *ret;
+
+ ret = bitmap_new();
+ if (!ret)
+ return NULL;
+
+ ret->bitmaps = newdup(uint64_t, b->bitmaps, b->n_bitmaps);
+ if (!ret->bitmaps) {
+ free(ret);
+ return NULL;
+ }
+
+ ret->n_bitmaps = ret->bitmaps_allocated = b->n_bitmaps;
+ return ret;
+}
+
void bitmap_free(Bitmap *b) {
if (!b)
return;