summaryrefslogtreecommitdiff
path: root/source/module/monitor_proc.c
diff options
context:
space:
mode:
authorzy <[email protected]>2023-12-01 11:20:02 +0800
committerzy <[email protected]>2023-12-01 11:20:02 +0800
commit4be788ed42d71c38dd5309627e7ce151f89a2344 (patch)
tree7f42b1f800422ec2e7d30fc342ebf235fbaa81b2 /source/module/monitor_proc.c
parentf4b44b9a0d3eb507a0e45b7ae957c6471074aeb0 (diff)
fix monitor_proc_exit bug
Diffstat (limited to 'source/module/monitor_proc.c')
-rw-r--r--source/module/monitor_proc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/module/monitor_proc.c b/source/module/monitor_proc.c
index 9ac983b..d901595 100644
--- a/source/module/monitor_proc.c
+++ b/source/module/monitor_proc.c
@@ -5,7 +5,7 @@
#include <linux/types.h>
#include <linux/uaccess.h>
-char *proc_dir = "variable_monitor";
+#define PROC_DIR = "variable_monitor"
int def_interval_ns = DEFAULT_INTERVAL_NS;
int dump_reset_sec = DEFAULT_DUMP_RESET_SEC;
@@ -67,7 +67,7 @@ static const struct proc_ops proc_dump_reset_sec_ops = {
int monitor_proc_init(void) {
struct proc_dir_entry *dir;
- dir = proc_mkdir(proc_dir, NULL);
+ dir = proc_mkdir(PROC_DIR, NULL);
if (!dir) {
pr_err("variable_monitor: failed to create /proc directory\n");
return -ENOMEM;
@@ -82,6 +82,6 @@ int monitor_proc_init(void) {
int monitor_proc_exit(void) {
remove_proc_entry("def_interval_ns", NULL);
remove_proc_entry("dump_reset_sec", NULL);
- remove_proc_entry(proc_dir, NULL);
+ remove_proc_subtree(PROC_DIR, NULL);
return 0;
} \ No newline at end of file