fdisk: add an quit/exit handling function
PATCH 1/6 fdisk: add an quit/exit handling function
From: Davidlohr Bueso <[email protected]>
Signed-off-by Davidlohr Bueso <[email protected]>
--- fdisk/fdisk.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-)
fdisk/fdisk.c +9 -6
@@ -1810,6 +1810,13 @@ move_begin(int i) { } } +static void __attribute__ ((__noreturn__))handle_quit (void ) +{ +close (fd); +printf ("\n" ); +exit (EXIT_SUCCESS ); +} +static void expert_command_prompt (void ) {
@@ -1875,9 +1882,7 @@ expert_command_prompt(void)x_list_table (0 );break ;case 'q' : -close (fd); -printf ("\n" ); -exit (0 ); +handle_quit ();case 'r' :return ;case 's' :
@@ -2064,9 +2069,7 @@ static void command_prompt(void)list_table (0 );break ;case 'q' : -close (fd); -printf ("\n" ); -exit (0 ); +handle_quit ();case 's' :create_sunlabel ();break ;
Signature · 1 line
1.7.4.1