feat: 设置默认读取二进制文件下目录的配置文件
This commit is contained in:
9
main.cc
9
main.cc
@@ -8,14 +8,19 @@
|
||||
#include "tomlc99/toml.h"
|
||||
#include "capture.h"
|
||||
|
||||
#define config_file_path "../config.toml"
|
||||
#define config_file_path "config.toml"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
FILE *fp;
|
||||
char errbuf[200];
|
||||
|
||||
fp = fopen(config_file_path, "r");
|
||||
char *config_path;
|
||||
config_path = getcwd(NULL, 0);
|
||||
sprintf(config_path, "%s/%s", config_path, config_file_path);
|
||||
|
||||
log_info("load config from %s", config_path);
|
||||
fp = fopen(config_path, "r");
|
||||
if (!fp)
|
||||
{
|
||||
log_error("can not open conifg file");
|
||||
|
||||
Reference in New Issue
Block a user