112 |
112 |
113 /* open the log file */ |
113 /* open the log file */ |
114 mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; |
114 mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; |
115 log_file_fd = open(cfg->file, O_WRONLY | O_CREAT | O_APPEND, mode); |
115 log_file_fd = open(cfg->file, O_WRONLY | O_CREAT | O_APPEND, mode); |
116 if(log_file_fd == -1) { |
116 if(log_file_fd == -1) { |
|
117 log_ereport(LOG_FAILURE, "Cannot open log file %s: %s", cfg->file, strerror(errno)); |
117 return -1; |
118 return -1; |
118 } |
119 } |
119 |
120 |
120 if(!strcmp(cfg->level, "ERROR")) { |
121 if(!strcmp(cfg->level, "ERROR")) { |
121 can_log[LOG_WARN] = 0; |
122 can_log[LOG_WARN] = 0; |