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-02.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File util-linux-agetty-smart-reload-02.patch of Package python-libmount
Backport, partial rewrite. From 36c55a89871d836a9c6a2832151f0ca907e83ea0 Mon Sep 17 00:00:00 2001 From: Stanislav Brabec <sbrabec@suse.cz> Date: Wed, 10 Oct 2018 19:26:27 +0200 Subject: [PATCH 02/14] agetty: Watch only protocol requested by issue escapes To decrease number of reloads, watch only protocol requested by \4 and \6 escapes in issue file. Signed-off-by: Stanislav Brabec <sbrabec@suse.cz> --- term-utils/agetty.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 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 @@ -141,6 +141,7 @@ # define AGETTY_RELOAD_FDNONE -2 /* uninitialized fd */ static int inotify_fd = AGETTY_RELOAD_FDNONE; static int netlink_fd = AGETTY_RELOAD_FDNONE; +static __u32 netlink_groups; #endif /* @@ -1536,7 +1537,7 @@ static void open_netlink(void) if (sock >= 0) { addr.nl_family = AF_NETLINK; addr.nl_pid = getpid(); - addr.nl_groups = RTMGRP_IPV4_IFADDR | RTMGRP_IPV6_IFADDR; + addr.nl_groups = netlink_groups; if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) close(sock); else @@ -1689,6 +1690,9 @@ static void print_issue_file(struct opti { #ifdef ISSUE FILE *fd; +#ifdef AGETTY_RELOAD + netlink_groups = 0; +#endif #endif if ((op->flags & F_NONL) == 0) { /* Issue not in use, start with a new line. */ @@ -1721,6 +1725,10 @@ static void print_issue_file(struct opti } fclose(fd); } +#ifdef AGETTY_RELOAD + if (netlink_groups != 0) + open_netlink(); +#endif #endif /* ISSUE */ } @@ -2487,13 +2495,10 @@ static void output_special_char(unsigned case '6': { sa_family_t family = c == '4' ? AF_INET : AF_INET6; + netlink_groups |= c == '4' ? RTMGRP_IPV4_IFADDR : RTMGRP_IPV6_IFADDR; struct ifaddrs *addrs = NULL; char iface[128]; -#ifdef AGETTY_RELOAD - open_netlink(); -#endif - if (getifaddrs(&addrs)) break;
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