crecord: truncate file to remove content of existing file
PATCH 1/1 crecord: truncate file to remove content of existing file
Without O_TRUNC overwriting bigger file by smaller one doesn't wipe the old file fully.
Signed-off-by Piotr Maziarz <[email protected]>
Signed-off-by Cezary Rojewski <[email protected]>
--- src/utils/crecord.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/utils/crecord.c +1 -1
@@ -323,7 +323,7 @@ static void capture_samples(char *name, unsigned int card, unsigned int device,if (!name) { file =STDOUT_FILENO ; }else { - file =open (name,O_RDWR |O_CREAT , + file =open (name,O_RDWR |O_CREAT |O_TRUNC ,S_IRUSR |S_IWUSR |S_IRGRP |S_IWGRP );if (file ==-1 ) {fprintf (stderr,"Unable to open file '%s'\n" , name);
Signature · 6 lines
2.7.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel