Re: [PATCH 2/3] dmesg: Delete redundant pager setup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2023-07-11 11:55, Karel Zak wrote:
On Tue, Jul 04, 2023 at 11:14:29AM +0200, Dragan Simic wrote:
The setup of the pager is already performed a few lines of code above,
so it's safe to delete the repeated setup, which actually does nothing.

Signed-off-by: Dragan Simic <dsimic@xxxxxxxxxxx>
---
 sys-utils/dmesg.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
index 02358e449..971712b56 100644
--- a/sys-utils/dmesg.c
+++ b/sys-utils/dmesg.c
@@ -1646,8 +1646,6 @@ int main(int argc, char *argv[])
 		/* only kmsg supports multi-line messages */
 		if (ctl.force_prefix && ctl.method != DMESG_METHOD_KMSG)
 			ctl.force_prefix = 0;
-		if (ctl.pager)
-			pager_redirect();

I have removed the initial (global) pager_redirect() call, because it
makes sense only for the section when it prints kernel messages.

https://github.com/util-linux/util-linux/commit/0619aa8fda39e40776dd2a73346bd7cc5ab4a33f

Nice catch, thanks. It's much better to do it that way, which may also be seen as a small performance improvement.



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux