commit
64658c0a4f
52
fdisk-fix-quit-dialog-for-non-libreadline-version.patch
Normal file
52
fdisk-fix-quit-dialog-for-non-libreadline-version.patch
Normal file
@ -0,0 +1,52 @@
|
||||
From 40af0db4cdadc50d9ba7ea77d8fa0689bf976f9f Mon Sep 17 00:00:00 2001
|
||||
From: Karel Zak <kzak@redhat.com>
|
||||
Date: Thu, 5 Sep 2019 12:34:01 +0200
|
||||
Subject: [PATCH] fdisk: fix quit dialog for non-libreadline version
|
||||
|
||||
We need to clear stdin errors otherwise it returns EOF forever after
|
||||
CTRL+D.
|
||||
|
||||
Reported-by: Lukas Czerner <lczerner@redhat.com>
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
---
|
||||
disk-utils/fdisk.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/disk-utils/fdisk.c b/disk-utils/fdisk.c
|
||||
index 81334d0..0502fa3 100644
|
||||
--- a/disk-utils/fdisk.c
|
||||
+++ b/disk-utils/fdisk.c
|
||||
@@ -109,6 +109,7 @@ int get_user_reply(const char *prompt, char *buf, size_t bufsz)
|
||||
if (is_interactive)
|
||||
rl_callback_handler_install(prompt, reply_linehandler);
|
||||
#endif
|
||||
+ errno = 0;
|
||||
reply_running = 1;
|
||||
do {
|
||||
int rc;
|
||||
@@ -158,6 +159,7 @@ int get_user_reply(const char *prompt, char *buf, size_t bufsz)
|
||||
if (!*buf) {
|
||||
DBG(ASK, ul_debug("cancel by CTRL+D"));
|
||||
ret = -ECANCELED;
|
||||
+ clearerr(stdin);
|
||||
goto done;
|
||||
}
|
||||
|
||||
@@ -168,13 +170,13 @@ int get_user_reply(const char *prompt, char *buf, size_t bufsz)
|
||||
if (sz && *(buf + sz - 1) == '\n')
|
||||
*(buf + sz - 1) = '\0';
|
||||
|
||||
- DBG(ASK, ul_debug("user's reply: >>>%s<<<", buf));
|
||||
done:
|
||||
#ifdef HAVE_LIBREADLINE
|
||||
if (is_interactive)
|
||||
rl_callback_handler_remove();
|
||||
#endif
|
||||
sigaction(SIGINT, &oldact, NULL);
|
||||
+ DBG(ASK, ul_debug("user's reply: >>>%s<<< [rc=%d]", buf, ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
Name: util-linux
|
||||
Version: %{_pre_version__}.1
|
||||
Release: 4
|
||||
Release: 5
|
||||
Summary: A random collection of Linux utilities
|
||||
License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain
|
||||
URL: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git
|
||||
@ -68,6 +68,7 @@ Patch6026: include-add-no-return-function-attribute.patch
|
||||
Patch6027: agetty-Fix-input-of-non-ASCII-characters-in-get_logn.patch
|
||||
Patch6028: script-be-sensitive-to-another-SIGCHLD-ssi_codes.patch
|
||||
Patch6029: su-be-sensitive-to-another-SIGCHLD-ssi_codes.patch
|
||||
Patch6030: fdisk-fix-quit-dialog-for-non-libreadline-version.patch
|
||||
|
||||
%description
|
||||
The util-linux package contains a random collection of files that
|
||||
@ -300,6 +301,12 @@ fi
|
||||
%{_mandir}/man8/{swapoff.8*,swapon.8*,switch_root.8*,umount.8*,wdctl.8.gz,wipefs.8*,zramctl.8*}
|
||||
|
||||
%changelog
|
||||
* Wed Jan 8 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.32.1-5
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:fix quit dialog for non-libreadline version
|
||||
|
||||
* Tue Dec 31 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.32.1-4
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user