diff options
author | Manuel Bentele | 2019-08-21 14:58:42 +0200 |
---|---|---|
committer | Manuel Bentele | 2019-08-21 14:58:42 +0200 |
commit | 0692b963aa3cb846d8abab5ef5247c4dbb3fec96 (patch) | |
tree | f13776d25da3e1adc1445aef22e7566ac98cbe84 /libfdisk/src/partition.c | |
parent | losetup: added file format option to the man page (diff) | |
parent | partx: document -d vs. --nr and fix test (diff) | |
download | kernel-qcow2-util-linux-kernel-qcow2.tar.gz kernel-qcow2-util-linux-kernel-qcow2.tar.xz kernel-qcow2-util-linux-kernel-qcow2.zip |
lib/losetup: merge remote-tracking branch 'util-linux/master'kernel-qcow2
Signed-off-by: Manuel Bentele <development@manuel-bentele.de>
Diffstat (limited to 'libfdisk/src/partition.c')
-rw-r--r-- | libfdisk/src/partition.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libfdisk/src/partition.c b/libfdisk/src/partition.c index 05474a041..80a43ffde 100644 --- a/libfdisk/src/partition.c +++ b/libfdisk/src/partition.c @@ -85,7 +85,13 @@ static struct fdisk_partition *__copy_partition(struct fdisk_partition *o) if (!n) return NULL; + memcpy(n, o, sizeof(*n)); + + /* do not copy reference to lists, etc.*/ + n->refcount = 1; + INIT_LIST_HEAD(&n->parts); + if (n->type) fdisk_ref_parttype(n->type); if (o->name) @@ -100,6 +106,10 @@ static struct fdisk_partition *__copy_partition(struct fdisk_partition *o) n->fsuuid = strdup(o->fsuuid); if (o->fslabel) n->fslabel = strdup(o->fslabel); + if (o->start_chs) + n->start_chs = strdup(o->start_chs); + if (o->end_chs) + n->end_chs = strdup(o->end_chs); return n; } |