diff options
| author | 杨威 <[email protected]> | 2023-01-12 09:43:43 +0800 |
|---|---|---|
| committer | 杨威 <[email protected]> | 2023-01-16 14:42:18 +0800 |
| commit | 39d375589e4267f0aaab9d3fd97734147ff6901b (patch) | |
| tree | a0374fb4d456fdd7c0f3b85e5ed1b42d63304960 /src/config/cmd_args.c | |
| parent | f6b17b84ed61198eeb5114e4462d0705f04d9865 (diff) | |
🧪 test(test_app_sapp): 增加timed测试dropme逻辑
Diffstat (limited to 'src/config/cmd_args.c')
| -rw-r--r-- | src/config/cmd_args.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/config/cmd_args.c b/src/config/cmd_args.c index ede0122..76de6fa 100644 --- a/src/config/cmd_args.c +++ b/src/config/cmd_args.c @@ -33,7 +33,6 @@ static char *popen_result_store(FILE *fp) int chr; char *exec_result; int exec_result_size = 0; - char line_buf[PATH_MAX]; exec_result = (char *)sapp_mem_calloc(SAPP_MEM_FIX_GLOBAL_VAL, MEM_STAT_GLOBAL_THREAD_ID, 1); @@ -86,11 +85,9 @@ static int get_dumpfile_list_array(const char *opt_arg) tobe_free_result = exec_result; sapp_global_val->cla.dumpfie_list_array = NULL; - while(ptr_cont = strtok_r(exec_result, delim, &save_ptr)){ + while((ptr_cont = strtok_r(exec_result, delim, &save_ptr))){ sapp_global_val->cla.dumpfie_list_array = (char **)sapp_mem_realloc(SAPP_MEM_FIX_GLOBAL_VAL, MEM_STAT_GLOBAL_THREAD_ID,sapp_global_val->cla.dumpfie_list_array, sizeof(void *) * (line_num + 2));//��ǰҪ�洢��ָ���ټ���EOF sapp_global_val->cla.dumpfie_list_array[line_num] = sapp_strdup(ptr_cont);; - - //printf("#### %d: result_content:%s\n", line_num, sapp_global_val->cla.dumpfie_list_array[line_num]); line_num++; exec_result = NULL; } @@ -374,7 +371,6 @@ void sapp_update_main_config_file(const char *main_entry_cfg) void sapp_update_config_root_dir(const char *cfg_root_dir) { - char sapp_cfg_filename[PATH_MAX]; sapp_config_file_link_t *pconfig; pconfig = &sapp_global_val->config.cfg_file_path; @@ -435,19 +431,15 @@ void sapp_update_data_root_dir(const char *data_root_dir) static void sapp_close_stdout(void) { -#if 0 - int null_fd = open("/dev/null", O_CREAT | O_RDWR); /* ����sappˢ����Ϣ */ - if(null_fd > 0){ - dup2(null_fd, STDOUT_FILENO); - } -#else if(stdout){ fclose(stdout); stdout = fopen("/dev/null", "w"); } -#endif } + +extern int sapp_config_check(void); + int sapp_parse_cmd_args(int argc, char *argv[]) { int ret = 0; |
