top: Fixing missing newline when running in the batch mode (#1008674)

This commit is contained in:
Jaromir Capik 2013-09-17 20:29:19 +02:00
parent 14f15687ca
commit 3fa51099ff
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,32 @@
From 19597fd95e0c8bcb54e4f87a43e20d36016c48cd Mon Sep 17 00:00:00 2001
From: Jim Warner <james.warner@comcast.net>
Date: Tue, 17 Sep 2013 00:00:00 -0500
Subject: [PATCH 2/2] top: restore the lost final newline when in Batch mode
This patch adds the final newline when exiting 'Batch'
mode. Interestingly, it has been missing since release
3.3.5 but undetected until the Redhat bugzilla report.
Reference(s):
https://bugzilla.redhat.com/show_bug.cgi?id=1008674
Signed-off-by: Jim Warner <james.warner@comcast.net>
---
top/top.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/top/top.c b/top/top.c
index 6f4f728..44bc380 100644
--- a/top/top.c
+++ b/top/top.c
@@ -527,6 +527,7 @@ static void bye_bye (const char *str) {
fputs(str, stderr);
exit(EXIT_FAILURE);
}
+ if (Batch) putp("\n");
exit(EXIT_SUCCESS);
} // end: bye_bye
--
1.8.1.2

View File

@ -4,7 +4,7 @@
Summary: System and process monitoring utilities
Name: procps-ng
Version: 3.3.8
Release: 13%{?dist}
Release: 14%{?dist}
License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+
Group: Applications/System
URL: https://sourceforge.net/projects/procps-ng/
@ -19,6 +19,7 @@ Patch4: 0002-top-cursor-repositioning-includes-line-oriented-inpu.patch
Patch5: procps-ng-3.3.8-RH-man-page-check.patch
Patch6: procps-ng-3.3.8-libselinux.patch
Patch7: procps-ng-3.3.8-free-shmem.patch
Patch8: 0002-top-restore-the-lost-final-newline-when-in-Batch-mod.patch
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
@ -85,6 +86,7 @@ System and process monitoring utilities development headers
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%build
# The following stuff is needed for git archives only
@ -151,6 +153,9 @@ mkdir -p %{buildroot}%{_sysconfdir}/sysctl.d
%{_includedir}/proc
%changelog
* Tue Sep 17 2013 Jaromir Capik <jcapik@redhat.com> - 3.3.8-14
- top: Fixing missing newline when running in the batch mode (#1008674)
* Fri Aug 09 2013 Jaromir Capik <jcapik@redhat.com> - 3.3.8-13
- Including forgotten man fixes (#948522)