mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-06 18:30:01 +00:00
Output newline after json output in mod_json_cdr
In UNIX, text files by definition end with a newline.
This commit is contained in:
parent
3bd9c60f8e
commit
09079098d1
@ -248,6 +248,8 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
|
|||||||
switch_ssize_t wrote = 0, x;
|
switch_ssize_t wrote = 0, x;
|
||||||
do { x = write(fd, json_text, json_len);
|
do { x = write(fd, json_text, json_len);
|
||||||
} while (!(x<0) && json_len > (wrote += x));
|
} while (!(x<0) && json_len > (wrote += x));
|
||||||
|
if (!(x<0)) do { x = write(fd, "\n", 1);
|
||||||
|
} while (!(x<0) && x<1);
|
||||||
close(fd); fd = -1;
|
close(fd); fd = -1;
|
||||||
if (x < 0) {
|
if (x < 0) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error writing [%s]\n",path);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error writing [%s]\n",path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user