sysctl -N <file> shows values instead of names

This commit is contained in:
Jan Rybar 2023-08-03 14:50:07 +02:00
parent d1d859d403
commit 7e5c25c863
2 changed files with 18 additions and 1 deletions

View File

@ -4,12 +4,13 @@
Summary: System and process monitoring utilities Summary: System and process monitoring utilities
Name: procps-ng Name: procps-ng
Version: 4.0.3 Version: 4.0.3
Release: 2%{?dist} Release: 3%{?dist}
License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+
URL: https://sourceforge.net/projects/procps-ng/ URL: https://sourceforge.net/projects/procps-ng/
Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz
Patch1: sysctl-nameonly-shows-value.patch
BuildRequires: make BuildRequires: make
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
@ -146,6 +147,9 @@ ln -s %{_bindir}/pidof %{buildroot}%{_sbindir}/pidof
%files i18n -f %{name}.lang %files i18n -f %{name}.lang
%changelog %changelog
* Thu Aug 03 2023 Jan Rybar <jrybar@redhat.com> - 4.0.3-3
- sysctl -N <file> shows values instead of names
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.3-2 * Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

View File

@ -0,0 +1,13 @@
diff --git a/src/sysctl.c b/src/sysctl.c
index d750091..bd851bb 100644
--- a/src/sysctl.c
+++ b/src/sysctl.c
@@ -612,7 +612,7 @@ static int WriteSetting(
}
if ((rc == EXIT_SUCCESS && !Quiet) || DryRun) {
if (NameOnly) {
- printf("%s\n", value);
+ printf("%s\n", dotted_key);
} else {
if (PrintName) {
printf("%s = %s\n", dotted_key, value);