mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-15 05:08:26 +00:00
Terminate format_cdr json files with newline
In UNIX, text files by definition end with a newline.
This commit is contained in:
parent
d5fa28417e
commit
63351a1061
@ -287,6 +287,9 @@ static switch_status_t my_on_reporting_cb(switch_core_session_t *session, cdr_pr
|
|||||||
#endif
|
#endif
|
||||||
int wrote;
|
int wrote;
|
||||||
wrote = write(fd, cdr_text, (unsigned) strlen(cdr_text));
|
wrote = write(fd, cdr_text, (unsigned) strlen(cdr_text));
|
||||||
|
if (!strcasecmp(profile->format, "json")) {
|
||||||
|
wrote += write(fd, "\n", 1);
|
||||||
|
}
|
||||||
wrote++;
|
wrote++;
|
||||||
close(fd);
|
close(fd);
|
||||||
fd = -1;
|
fd = -1;
|
||||||
@ -454,6 +457,9 @@ static switch_status_t my_on_reporting_cb(switch_core_session_t *session, cdr_pr
|
|||||||
#endif
|
#endif
|
||||||
int wrote;
|
int wrote;
|
||||||
wrote = write(fd, cdr_text, (unsigned) strlen(cdr_text));
|
wrote = write(fd, cdr_text, (unsigned) strlen(cdr_text));
|
||||||
|
if (!strcasecmp(profile->format, "json")) {
|
||||||
|
wrote += write(fd, "\n", 1);
|
||||||
|
}
|
||||||
wrote++;
|
wrote++;
|
||||||
close(fd);
|
close(fd);
|
||||||
fd = -1;
|
fd = -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user