From: Victor Dodon <dodonvictor@gmail.com>
To: util-linux@vger.kernel.org
Cc: Victor Dodon <dodonvictor@gmail.com>
Subject: [PATCH] sfdisk: exit with error if rereading partition table fails
Date: Thu, 21 Apr 2016 00:24:58 -0700 [thread overview]
Message-ID: <1461223498-19392-1-git-send-email-dodonvictor@gmail.com> (raw)
Use the return value of fdisk_reread_partition_table in write_changes so that
sfdisk exits with error if re-reading the partition table fails.
Signed-off-by: Victor Dodon <dodonvictor@gmail.com>
---
disk-utils/sfdisk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
index 15fa99c..b520c9b 100644
--- a/disk-utils/sfdisk.c
+++ b/disk-utils/sfdisk.c
@@ -534,7 +534,7 @@ static int write_changes(struct sfdisk *sf)
rc = move_partition_data(sf, sf->partno, sf->orig_pa);
if (!rc) {
fdisk_info(sf->cxt, _("\nThe partition table has been altered."));
- fdisk_reread_partition_table(sf->cxt);
+ rc = fdisk_reread_partition_table(sf->cxt);
}
}
if (!rc)
--
2.8.0
next reply other threads:[~2016-04-21 7:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-21 7:24 Victor Dodon [this message]
2016-04-21 8:44 ` [PATCH] sfdisk: exit with error if rereading partition table fails Karel Zak
2016-05-05 9:45 ` Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1461223498-19392-1-git-send-email-dodonvictor@gmail.com \
--to=dodonvictor@gmail.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox