system: nxrecorder: Add O_TRUNC when creating a file

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
Masayuki Ishikawa 2020-06-16 16:11:23 +09:00 committed by Xiang Xiao
parent db338bfbb2
commit 2282310483

View File

@ -847,7 +847,7 @@ int nxrecorder_recordraw(FAR struct nxrecorder_s *precorder,
/* Test that the specified file exists */
if ((precorder->fd = open(pfilename, O_WRONLY | O_CREAT)) == -1)
if ((precorder->fd = open(pfilename, O_WRONLY | O_CREAT | O_TRUNC)) == -1)
{
/* File not found. Test if its in the mediadir */