summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2013-06-25 14:47:24 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2013-06-25 14:47:24 +0200
commitd9b7cfc83407e367c194b2db895115870b703aa6 (patch)
treedaf8acd1cf1f825c79ac3f3b590de6ce10a8c52d
parent7a2b8b682ecb987a7762ef2adc57a3073fcb0ba1 (diff)
Truncate existing files when writing frames to memory
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--yavta.c2
1 files changed, 1 insertions, 1 deletions
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)