diff options
author | Karel Zak | 2017-08-24 15:37:16 +0200 |
---|---|---|
committer | Karel Zak | 2017-08-24 15:48:46 +0200 |
commit | c1154128db5f2359d7825d048134ac262af10b6b (patch) | |
tree | dd4bdcdb683cf78a9cfa4b4fe93f33bfe72a7c87 /disk-utils/fdisk.h | |
parent | fdisk: handle SIGINT in dialogs as cancel (diff) | |
download | kernel-qcow2-util-linux-c1154128db5f2359d7825d048134ac262af10b6b.tar.gz kernel-qcow2-util-linux-c1154128db5f2359d7825d048134ac262af10b6b.tar.xz kernel-qcow2-util-linux-c1154128db5f2359d7825d048134ac262af10b6b.zip |
fdisk: fix readline interaction with signals
The high-level readline API is crazy to use with signals. Fortunately
the library provides low-level rl_callback_* API. In this case we can
use poll() to wait for input and control all signals, etc.
This patch also a little changes fdisk behavior on CTRL+C and CTRL+D.
The signals does not kill fdisk, but forces fdisk to return to the
main menu, if already in the main menu then exit. If the disk layout
has been modified than ask "Do you really want to exit...".
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/fdisk.h')
-rw-r--r-- | disk-utils/fdisk.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/disk-utils/fdisk.h b/disk-utils/fdisk.h index f738fa478..e1147e20b 100644 --- a/disk-utils/fdisk.h +++ b/disk-utils/fdisk.h @@ -27,13 +27,13 @@ extern int pwipemode; extern struct fdisk_table *original_layout; extern int device_is_used; +extern int is_interactive; UL_DEBUG_DECLARE_MASK(fdisk); #define DBG(m, x) __UL_DBG(fdisk, FDISKPROG_DEBUG_, m, x) #define ON_DBG(m, x) __UL_DBG_CALL(fdisk, FDISKPROG_DEBUG_, m, x) -extern int get_user_reply(struct fdisk_context *cxt, - const char *prompt, +extern int get_user_reply(const char *prompt, char *buf, size_t bufsz); extern int process_fdisk_menu(struct fdisk_context **cxt); |