Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP4:Update
python-libmount
util-linux-agetty-smart-reload-05.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File util-linux-agetty-smart-reload-05.patch of Package python-libmount
Backport. From 980a6e431cf69107a96e1a365be43f66fd3ccb2a Mon Sep 17 00:00:00 2001 From: Karel Zak <kzak@redhat.com> Date: Thu, 11 Oct 2018 13:21:23 +0200 Subject: [PATCH 05/14] agetty: cleanup issue output change, remove bool Signed-off-by: Karel Zak <kzak@redhat.com> --- term-utils/agetty.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) Index: util-linux-2.29.2/term-utils/agetty.c =================================================================== --- util-linux-2.29.2.orig/term-utils/agetty.c +++ util-linux-2.29.2/term-utils/agetty.c @@ -28,7 +28,6 @@ #include <utmp.h> #include <getopt.h> #include <time.h> -#include <stdbool.h> #include <sys/file.h> #include <sys/socket.h> #include <langinfo.h> @@ -1706,18 +1705,17 @@ static int wait_for_term_input(int fd) } #endif /* AGETTY_RELOAD */ #ifdef ISSUE -static bool cmp_issue_file(struct issue *ie) +static int issue_is_changed(struct issue *ie) { - if (ie->mem_old && ie->mem) { - if (!strcmp(ie->mem_old, ie->mem)) { - free(ie->mem_old); - ie->mem_old = ie->mem; - ie->mem = NULL; - return false; - } - } else - return true; - return true; + if (ie->mem_old && ie->mem + && strcmp(ie->mem_old, ie->mem) == 0) { + free(ie->mem_old); + ie->mem_old = ie->mem; + ie->mem = NULL; + return 0; + } + + return 1; } #endif @@ -1773,7 +1771,7 @@ static void eval_issue_file(struct issue if ((op->flags & F_ISSUE) && (fd = fopen(op->issue, "r"))) { int c; - ie->do_tcsetattr = true; + ie->do_tcsetattr = 1; while ((c = getc(fd)) != EOF) { if (c == '\\') @@ -1784,7 +1782,7 @@ static void eval_issue_file(struct issue fflush(stdout); if ((op->flags & F_VCONSOLE) == 0) - ie->do_tcrestore = true; + ie->do_tcrestore = 1; fclose(fd); } #ifdef AGETTY_RELOAD @@ -1808,7 +1806,7 @@ again: #ifdef AGETTY_RELOAD if (!wait_for_term_input(STDIN_FILENO)) { eval_issue_file(ie, op, tp); - if (cmp_issue_file(ie)) { + if (issue_is_changed(ie)) { if (op->flags & F_VCONSOLE) termio_clear(STDOUT_FILENO); goto again; @@ -1928,7 +1926,7 @@ static char *get_logname(struct issue *i if ((op->flags & F_VCONSOLE) == 0) sleep(1); eval_issue_file(ie, op, tp); - if (!cmp_issue_file(ie)) + if (!issue_is_changed(ie)) goto no_reload; tcflush(STDIN_FILENO, TCIFLUSH);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor