From d9b7cfc83407e367c194b2db895115870b703aa6 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 25 Jun 2013 14:47:24 +0200 Subject: Truncate existing files when writing frames to memory Signed-off-by: Laurent Pinchart --- yavta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yavta.c b/yavta.c index 2e9561c..03fd98f 100644 --- a/yavta.c +++ b/yavta.c @@ -1065,7 +1065,7 @@ static void video_save_image(struct device *dev, struct v4l2_buffer *buf, append = true; } - fd = open(filename, O_CREAT | O_WRONLY | (append ? O_APPEND : 0), + fd = open(filename, O_CREAT | O_WRONLY | (append ? O_APPEND : O_TRUNC), S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); free(filename); if (fd == -1) -- cgit v1.2.3