From 031c0bc8c5e087eefd940186e70a001675720762 Mon Sep 17 00:00:00 2001 From: zy Date: Fri, 1 Dec 2023 11:31:46 +0800 Subject: [PATCH] fix remove_proc_subtree --- source/module/monitor_proc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/module/monitor_proc.c b/source/module/monitor_proc.c index d901595..9603d5b 100644 --- a/source/module/monitor_proc.c +++ b/source/module/monitor_proc.c @@ -5,7 +5,7 @@ #include #include -#define PROC_DIR = "variable_monitor" +const char* 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; @@ -80,8 +80,8 @@ 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_subtree(PROC_DIR, NULL); + // remove_proc_entry("def_interval_ns", NULL); + // remove_proc_entry("dump_reset_sec", NULL); + remove_proc_subtree(proc_dir, NULL); return 0; } \ No newline at end of file