mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
Fix CDR CSV to flush on CDR
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -184,7 +184,7 @@ static int build_csv_record(char *buf, size_t bufsize, struct ast_cdr *cdr)
|
|||||||
|
|
||||||
static int writefile(char *s, char *acc)
|
static int writefile(char *s, char *acc)
|
||||||
{
|
{
|
||||||
char tmp[256];
|
char tmp[AST_CONFIG_MAX_PATH];
|
||||||
FILE *f;
|
FILE *f;
|
||||||
if (strchr(acc, '/') || (acc[0] == '.')) {
|
if (strchr(acc, '/') || (acc[0] == '.')) {
|
||||||
ast_log(LOG_WARNING, "Account code '%s' insecure for writing file\n", acc);
|
ast_log(LOG_WARNING, "Account code '%s' insecure for writing file\n", acc);
|
||||||
@@ -195,6 +195,7 @@ static int writefile(char *s, char *acc)
|
|||||||
if (!f)
|
if (!f)
|
||||||
return -1;
|
return -1;
|
||||||
fputs(s, f);
|
fputs(s, f);
|
||||||
|
fflush(f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user