src/server/daemon/log.c

changeset 392
0aef555055ee
parent 256
19259b6c5cf7
child 415
d938228c382e
equal deleted inserted replaced
391:80ee93a7d257 392:0aef555055ee
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;

mercurial