提交 63351a10 authored 作者: Travis Cross's avatar Travis Cross

Terminate format_cdr json files with newline

In UNIX, text files by definition end with a newline.
上级 d5fa2841
......@@ -287,6 +287,9 @@ static switch_status_t my_on_reporting_cb(switch_core_session_t *session, cdr_pr
#endif
int wrote;
wrote = write(fd, cdr_text, (unsigned) strlen(cdr_text));
if (!strcasecmp(profile->format, "json")) {
wrote += write(fd, "\n", 1);
}
wrote++;
close(fd);
fd = -1;
......@@ -454,6 +457,9 @@ static switch_status_t my_on_reporting_cb(switch_core_session_t *session, cdr_pr
#endif
int wrote;
wrote = write(fd, cdr_text, (unsigned) strlen(cdr_text));
if (!strcasecmp(profile->format, "json")) {
wrote += write(fd, "\n", 1);
}
wrote++;
close(fd);
fd = -1;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论