Set truncate flag to make sure that overwriting a existing file doesn't result in a mix of old and new content.
This commit is contained in:
parent
fda38428d9
commit
f67506ba2a
1 changed files with 2 additions and 2 deletions
|
@ -30,7 +30,7 @@
|
|||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
* $Id: cfs-posix.c,v 1.7 2007/12/21 01:36:01 oliverschmidt Exp $
|
||||
* $Id: cfs-posix.c,v 1.8 2007/12/23 14:12:44 oliverschmidt Exp $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -43,7 +43,7 @@
|
|||
int
|
||||
cfs_open(const char *n, int f)
|
||||
{
|
||||
return open(n, f == CFS_READ? O_RDONLY: O_CREAT|O_RDWR);
|
||||
return open(n, f == CFS_READ? O_RDONLY: O_CREAT|O_TRUNC|O_RDWR);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue