!2 util-linux

Merge pull request !2 from syyhao/init
This commit is contained in:
openeuler-ci-bot 2020-01-09 09:55:10 +08:00 committed by Gitee
commit 64658c0a4f
2 changed files with 60 additions and 1 deletions

View 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

View File

@ -3,7 +3,7 @@
Name: util-linux Name: util-linux
Version: %{_pre_version__}.1 Version: %{_pre_version__}.1
Release: 4 Release: 5
Summary: A random collection of Linux utilities Summary: A random collection of Linux utilities
License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain 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 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 Patch6027: agetty-Fix-input-of-non-ASCII-characters-in-get_logn.patch
Patch6028: script-be-sensitive-to-another-SIGCHLD-ssi_codes.patch Patch6028: script-be-sensitive-to-another-SIGCHLD-ssi_codes.patch
Patch6029: su-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 %description
The util-linux package contains a random collection of files that 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*} %{_mandir}/man8/{swapoff.8*,swapon.8*,switch_root.8*,umount.8*,wdctl.8.gz,wipefs.8*,zramctl.8*}
%changelog %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 * Tue Dec 31 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.32.1-4
- Type:enhancement - Type:enhancement
- ID:NA - ID:NA