代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/sysstat 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From cfddf05021b151fdd16830cef764bf180b273ec8 Mon Sep 17 00:00:00 2001
From: Zhikun Shan <[email protected]>
Date: Wed, 7 Aug 2019 02:23:19 -0400
Subject: [PATCH] sysstat: bugfix sysstat 10.1.5 read ttyAMA first for arm64
reason:read ttyAMA first for arm64.
Signed-off-by: Zhikun Shan <[email protected]>
---
count.c | 7 +++++--
rd_stats.c | 7 +++++--
rd_stats.h | 1 +
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/count.c b/count.c
index d84ae7a..56864d3 100644
--- a/count.c
+++ b/count.c
@@ -317,8 +317,11 @@ __nr_t get_serial_nr(void)
char line[256];
__nr_t sl = 0;
- if ((fp = fopen(SERIAL, "r")) == NULL)
- return 0; /* No SERIAL file */
+ if ((fp = fopen(TTYAMA, "r")) == NULL) {
+ if ((fp = fopen(SERIAL, "r")) == NULL) {
+ return 0; /* No SERIAL file */
+ }
+ }
while (fgets(line, sizeof(line), fp) != NULL) {
/*
diff --git a/rd_stats.c b/rd_stats.c
index 68e2799..8ccfec4 100644
--- a/rd_stats.c
+++ b/rd_stats.c
@@ -871,8 +871,11 @@ __nr_t read_tty_driver_serial(struct stats_serial *st_serial, __nr_t nr_alloc)
char *p;
__nr_t sl_read = 0;
- if ((fp = fopen(SERIAL, "r")) == NULL)
- return 0;
+ if ((fp = fopen(TTYAMA, "r")) == NULL) {
+ if ((fp = fopen(SERIAL, "r")) == NULL) {
+ return;
+ }
+ }
while (fgets(line, sizeof(line), fp) != NULL ) {
diff --git a/rd_stats.h b/rd_stats.h
index bc99127..599fbea 100644
--- a/rd_stats.h
+++ b/rd_stats.h
@@ -54,6 +54,7 @@
/* Files */
#define SERIAL PRE "/proc/tty/driver/serial"
+#define TTYAMA PRE "/proc/tty/driver/ttyAMA"
#define FDENTRY_STATE PRE "/proc/sys/fs/dentry-state"
#define FFILE_NR PRE "/proc/sys/fs/file-nr"
#define FINODE_STATE PRE "/proc/sys/fs/inode-state"
--
2.19.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。