From 2d17024a365126cd94df28519c4fecd24049bc08 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Thu, 21 Nov 2024 08:03:09 +0000 Subject: automatic import of sysmonitor-kmod --- bugfix-fix-fd-path-failed-to-open.patch | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 bugfix-fix-fd-path-failed-to-open.patch (limited to 'bugfix-fix-fd-path-failed-to-open.patch') diff --git a/bugfix-fix-fd-path-failed-to-open.patch b/bugfix-fix-fd-path-failed-to-open.patch new file mode 100644 index 0000000..bab67b0 --- /dev/null +++ b/bugfix-fix-fd-path-failed-to-open.patch @@ -0,0 +1,48 @@ +From 9241d98bc5803d18b1e17bd3ba1b84e97207fab4 Mon Sep 17 00:00:00 2001 +From: tenglei +Date: Thu, 11 Apr 2024 17:55:13 +0800 +Subject: [PATCH] bugfix fix fd path failed to open + +--- + src/sys_event.c | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +diff --git a/src/sys_event.c b/src/sys_event.c +index 61701ec..dbdb9d0 100644 +--- a/src/sys_event.c ++++ b/src/sys_event.c +@@ -544,15 +544,25 @@ static int chang_kernel_interface_value(void) + return -1; + } + +- ret = set_value_to_file(buf, PROC_FDTHRESHOLD); +- if (ret == -1) { +- log_printf(LOG_ERR, "chang_kernel_interface_value: set_value_to_file failed"); ++ if (access(PROC_FDTHRESHOLD, F_OK) == 0) { ++ ret = set_value_to_file(buf, PROC_FDTHRESHOLD); ++ if (ret == -1) { ++ log_printf(LOG_ERR, "chang_kernel_interface_value: set_value_to_file failed"); ++ return -1; ++ } ++ } else { ++ log_printf(LOG_ERR, "fdthreshold function is not supported in the current system environment"); + return -1; + } + +- ret = set_value_to_file("1", RROC_FDENABLE); +- if (ret == -1) { +- log_printf(LOG_ERR, "chang_kernel_interface_value: set_value_to_file failed"); ++ if (access(RROC_FDENABLE, F_OK) == 0) { ++ ret = set_value_to_file("1", RROC_FDENABLE); ++ if (ret == -1) { ++ log_printf(LOG_ERR, "chang_kernel_interface_value: set_value_to_file failed"); ++ return -1; ++ } ++ } else { ++ log_printf(LOG_ERR, "fdenable function is not supported in the current system environment"); + return -1; + } + +-- +2.27.0 + -- cgit v1.2.3