Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

日志存储文件关于文件指针的判断问题 #128

Open
hewenge opened this issue Nov 21, 2022 · 1 comment
Open

日志存储文件关于文件指针的判断问题 #128

hewenge opened this issue Nov 21, 2022 · 1 comment

Comments

@hewenge
Copy link

hewenge commented Nov 21, 2022

  1. elog_file_config函数中打开配置文件的代码如下:
    if (local_cfg.name != NULL && strlen(local_cfg.name) > 0)
    fp = fopen(local_cfg.name, "a+");
    }

  2. elog_file_write这个函数中就直接对fp进行操作,而没有继续对文件指针进行判断,如果上面配置的文件不存在,这里会导致异常。

@BrotherLAU
Copy link

这个接口没问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants