forked from pool/util-linux
Stanislav Brabec
bb4a013d42
- agetty: Fixes for reload issue only if it is really needed (bsc#1085196, boo#1120298, util-linux-agetty-smart-reload-10.patch, util-linux-agetty-smart-reload-11.patch, util-linux-agetty-smart-reload-12.patch). OBS-URL: https://build.opensuse.org/request/show/662937 OBS-URL: https://build.opensuse.org/package/show/Base:System/util-linux?expand=0&rev=391
60 lines
1.6 KiB
Diff
60 lines
1.6 KiB
Diff
From d7a412fe0ae5fa08b891769be2961e5d80769484 Mon Sep 17 00:00:00 2001
|
|
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
|
|
Date: Mon, 12 Nov 2018 11:31:17 +0100
|
|
Subject: [PATCH] agetty: fix portability issues
|
|
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
---
|
|
term-utils/agetty.c | 6 +++++-
|
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
|
|
index 05a269abb..759cea5b8 100644
|
|
--- a/term-utils/agetty.c
|
|
+++ b/term-utils/agetty.c
|
|
@@ -1768,6 +1768,7 @@ static void eval_issue_file(struct issue *ie __attribute__((__unused__)),
|
|
}
|
|
#else /* ISSUE_SUPPORT */
|
|
|
|
+#ifdef AGETTY_RELOAD
|
|
static int issue_is_changed(struct issue *ie)
|
|
{
|
|
if (ie->mem_old && ie->mem
|
|
@@ -1780,6 +1781,7 @@ static int issue_is_changed(struct issue *ie)
|
|
|
|
return 1;
|
|
}
|
|
+#endif
|
|
|
|
static void print_issue_file(struct issue *ie,
|
|
struct options *op,
|
|
@@ -2066,8 +2068,8 @@ static char *get_logname(struct issue *ie, struct options *op, struct termios *t
|
|
/* Write issue file and prompt */
|
|
do_prompt(ie, op, tp);
|
|
|
|
-#ifdef AGETTY_RELOAD
|
|
no_reload:
|
|
+#ifdef AGETTY_RELOAD
|
|
if (!wait_for_term_input(STDIN_FILENO)) {
|
|
/* refresh prompt -- discard input data, clear terminal
|
|
* and call do_prompt() again
|
|
@@ -2731,6 +2733,7 @@ static void output_special_char(struct issue *ie,
|
|
fprintf (ie->output, "%d ", users);
|
|
break;
|
|
}
|
|
+#if defined(RTMGRP_IPV4_IFADDR) && defined(RTMGRP_IPV6_IFADDR)
|
|
case '4':
|
|
case '6':
|
|
{
|
|
@@ -2754,6 +2757,7 @@ static void output_special_char(struct issue *ie,
|
|
netlink_groups |= RTMGRP_IPV6_IFADDR;
|
|
break;
|
|
}
|
|
+#endif
|
|
default:
|
|
putchar(c);
|
|
break;
|
|
--
|
|
2.19.1
|
|
|