aboutsummaryrefslogtreecommitdiffstats
path: root/disk-utils/sfdisk.c
diff options
context:
space:
mode:
Diffstat (limited to 'disk-utils/sfdisk.c')
-rw-r--r--disk-utils/sfdisk.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
index 192e9f951e..54d3b60e71 100644
--- a/disk-utils/sfdisk.c
+++ b/disk-utils/sfdisk.c
@@ -1890,10 +1890,11 @@ static int command_fdisk(struct sfdisk *sf, int argc, char **argv)
if (!created) { /* create a new disklabel */
rc = fdisk_apply_script_headers(sf->cxt, dp);
created = !rc;
- if (rc)
- fdisk_warnx(sf->cxt, _(
- "Failed to apply script headers, "
- "disk label not created."));
+ if (rc) {
+ errno = -rc;
+ fdisk_warn(sf->cxt, _(
+ "Failed to apply script headers, disk label not created"));
+ }
if (rc == 0 && fdisk_get_collision(sf->cxt))
follow_wipe_mode(sf);