diff options
author | Karel Zak | 2017-11-03 19:34:49 +0100 |
---|---|---|
committer | Karel Zak | 2017-11-03 19:34:49 +0100 |
commit | 9d4081cd6d5531145278f59d52bbb6a1d6d1db9b (patch) | |
tree | 5c5e03c8b31a86303e848978443c5d12400e32b4 /disk-utils/sfdisk.c | |
parent | tests: update default lsmem output (diff) | |
download | kernel-qcow2-util-linux-9d4081cd6d5531145278f59d52bbb6a1d6d1db9b.tar.gz kernel-qcow2-util-linux-9d4081cd6d5531145278f59d52bbb6a1d6d1db9b.tar.xz kernel-qcow2-util-linux-9d4081cd6d5531145278f59d52bbb6a1d6d1db9b.zip |
sfdisk: create empty label on 'write' command
Addresses: https://github.com/karelzak/util-linux/issues/528
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/sfdisk.c')
-rw-r--r-- | disk-utils/sfdisk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c index ac4f71106..d769ed8db 100644 --- a/disk-utils/sfdisk.c +++ b/disk-utils/sfdisk.c @@ -1776,7 +1776,7 @@ static int command_fdisk(struct sfdisk *sf, int argc, char **argv) } while (1); /* create empty disk label if label, but no partition specified */ - if (rc == SFDISK_DONE_EOF && created == 0 + if ((rc == SFDISK_DONE_EOF || rc == SFDISK_DONE_WRITE) && created == 0 && fdisk_script_has_force_label(dp) == 1 && fdisk_table_get_nents(tb) == 0 && fdisk_script_get_header(dp, "label")) { |