Terminate format_cdr json files with newline

In UNIX, text files by definition end with a newline.
This commit is contained in:
Travis Cross 2014-06-25 23:30:54 +00:00
parent d5fa28417e
commit 63351a1061
1 changed files with 6 additions and 0 deletions

View File

@ -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;