get_base_path_from_conf_file_ex support parameter: noent_log_level
parent
6b70919699
commit
47fb7b2abd
3
HISTORY
3
HISTORY
|
|
@ -1,4 +1,7 @@
|
|||
|
||||
Version 1.61 2022-09-21
|
||||
* get_base_path_from_conf_file_ex support parameter: noent_log_level
|
||||
|
||||
Version 1.60 2022-08-27
|
||||
* normalize_path for base_path
|
||||
* struct fast_task_info add field recv_body for dynamic recv buffer
|
||||
|
|
|
|||
|
|
@ -274,8 +274,8 @@ int process_exist(const char *pidFilename, pid_t *pid)
|
|||
}
|
||||
}
|
||||
|
||||
int get_base_path_from_conf_file(const char *filename, char *base_path,
|
||||
const int path_size)
|
||||
int get_base_path_from_conf_file_ex(const char *filename, char *base_path,
|
||||
const int path_size, const int noent_log_level)
|
||||
{
|
||||
char *pBasePath;
|
||||
IniContext iniContext;
|
||||
|
|
@ -306,13 +306,14 @@ int get_base_path_from_conf_file(const char *filename, char *base_path,
|
|||
normalize_path(NULL, pBasePath, base_path, path_size);
|
||||
chopPath(base_path);
|
||||
if (!fileExists(base_path))
|
||||
{
|
||||
logError("file: "__FILE__", line: %d, " \
|
||||
"\"%s\" can't be accessed, error info: %s", \
|
||||
__LINE__, base_path, STRERROR(errno));
|
||||
result = errno != 0 ? errno : ENOENT;
|
||||
break;
|
||||
}
|
||||
{
|
||||
result = errno != 0 ? errno : ENOENT;
|
||||
log_it_ex(&g_log_context, noent_log_level,
|
||||
"file: "__FILE__", line: %d, "
|
||||
"\"%s\" can't be accessed, error info: %s",
|
||||
__LINE__, base_path, STRERROR(result));
|
||||
break;
|
||||
}
|
||||
if (!isDir(base_path))
|
||||
{
|
||||
logError("file: "__FILE__", line: %d, " \
|
||||
|
|
|
|||
|
|
@ -27,8 +27,11 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
int get_base_path_from_conf_file(const char *filename, char *base_path,
|
||||
const int path_size);
|
||||
int get_base_path_from_conf_file_ex(const char *filename, char *base_path,
|
||||
const int path_size, const int noent_log_level);
|
||||
|
||||
#define get_base_path_from_conf_file(filename, base_path, path_size) \
|
||||
get_base_path_from_conf_file_ex(filename, base_path, path_size, LOG_ERR)
|
||||
|
||||
int get_pid_from_file(const char *pidFilename, pid_t *pid);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue