diff options
| author | Karel Zak <kzak@redhat.com> | 2023-06-26 13:25:11 +0200 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2023-06-26 13:27:11 +0200 |
| commit | b0d4d093796c3a3776b155e4ec7e2aa7cb09677d (patch) | |
| tree | a26ab70f95d0682916a2543c8c958d800c18e72e /disk-utils/cfdisk.c | |
| parent | fa6ac102dc1bca83d75af423a2be3e377d60432e (diff) | |
| download | util-linux-b0d4d093796c3a3776b155e4ec7e2aa7cb09677d.tar.gz | |
cfdisk: fix menu behavior after writing changes
Florian wrote:
after a successful write, cfdisk remains on the "Write" cursor and
furthermore when navigating to "Quit" will continue to show
"...without writing changes", despite there were writes. This patch
addresses that.
Based on patch from Florian Zimmermann <florian.zimmermann@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/cfdisk.c')
| -rw-r--r-- | disk-utils/cfdisk.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c index 2e29421d72..e5c1fd8283 100644 --- a/disk-utils/cfdisk.c +++ b/disk-utils/cfdisk.c @@ -2525,11 +2525,15 @@ static int main_menu_action(struct cfdisk *cf, int key) if (rc) warn = _("Failed to write disklabel."); else { + size_t q_idx = 0; + if (cf->device_is_used) fdisk_reread_changes(cf->cxt, cf->original_layout); else fdisk_reread_partition_table(cf->cxt); info = _("The partition table has been altered."); + if (menu_get_menuitem_by_key(cf, 'q', &q_idx)) + ui_menu_goto(cf, q_idx); } cf->nwrites++; break; |
