procps/0033-top-follow-usual-name-conventions-for-global-variabl.patch

61 lines
2.1 KiB
Diff

From 4c464acf283b83f052af075f1190f146550c77a5 Mon Sep 17 00:00:00 2001
From: Jim Warner <james.warner@comcast.net>
Date: Sat, 30 Nov 2013 00:00:00 -0600
Subject: [PATCH] top: follow usual name conventions for global variable
A recent change involving a one cycle stderr redirect,
to handle a libnuma potential transgression, failed to
follow normal global variable naming conventions. This
patch will capitalize the 1st letter of 'Stderr_save'.
Reference(s):
commit 35dc6dcc49cc9cf8cff4300cb03a38dbe44c05db
Signed-off-by: Jim Warner <james.warner@comcast.net>
---
top/top.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git top/top.c top/top.c
index 59dcb3f..4d1d912 100644
--- top/top.c
+++ top/top.c
@@ -220,7 +220,7 @@ static int Numa_node_tot;
static int Numa_node_sel = -1;
#ifndef NUMA_DISABLE
static void *Libnuma_handle;
-static int stderr_save = -1;
+static int Stderr_save = -1;
#if defined(PRETEND_NUMA) || defined(PRETEND8CPUS)
static int Numa_max_node(void) { return 3; }
static int Numa_node_of_cpu(int num) { return (num % 4); }
@@ -4069,8 +4069,8 @@ static void wins_stage_2 (void) {
Yes, he provides some overridable 'weak' functions to change such
behavior but we can't exploit that since we don't follow a normal
ld route to symbol resolution (we use that dlopen() guy instead)! */
- stderr_save = dup(fileno(stderr));
- if (-1 < stderr_save && freopen("/dev/null", "w", stderr))
+ Stderr_save = dup(fileno(stderr));
+ if (-1 < Stderr_save && freopen("/dev/null", "w", stderr))
; // avoid -Wunused-result
#endif
@@ -5553,10 +5553,10 @@ static void frame_make (void) {
#ifndef NUMA_DISABLE
/* we gotta reverse the stderr redirect which was employed in wins_stage_2
and needed because the two libnuma 'weak' functions were useless to us! */
- if (-1 < stderr_save) {
- dup2(stderr_save, fileno(stderr));
- close(stderr_save);
- stderr_save = -1;
+ if (-1 < Stderr_save) {
+ dup2(Stderr_save, fileno(stderr));
+ close(Stderr_save);
+ Stderr_save = -1;
}
#endif
--
1.7.9.2