rename(log_file, old);
free(old);
}
- sender.fd = open(log_file, O_CREAT | O_WRONLY | O_TRUNC);
+ sender.fd = open(log_file, O_CREAT | O_WRONLY | O_APPEND, 0600);
if (sender.fd < 0) {
// fprintf(stderr, "failed to open %s: %s\n", log_file, strerror(errno));
exit(-1);
uloop_timeout_set(&retry, 1000);
} else if (log_file) {
log_type = LOG_FILE;
- sender.fd = open(log_file, O_CREAT | O_WRONLY);
+ sender.fd = open(log_file, O_CREAT | O_WRONLY| O_APPEND, 0600);
if (sender.fd < 0) {
fprintf(stderr, "failed to open %s: %s\n", log_file, strerror(errno));
exit(-1);