From f67506ba2a0794ffdd88c9f90e63e3fbb25d15d0 Mon Sep 17 00:00:00 2001 From: oliverschmidt Date: Sun, 23 Dec 2007 14:12:44 +0000 Subject: [PATCH] Set truncate flag to make sure that overwriting a existing file doesn't result in a mix of old and new content. --- core/cfs/cfs-posix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/cfs/cfs-posix.c b/core/cfs/cfs-posix.c index 71bfa4f18..d0a6ae850 100644 --- a/core/cfs/cfs-posix.c +++ b/core/cfs/cfs-posix.c @@ -30,7 +30,7 @@ * * Author: Adam Dunkels * - * $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 @@ -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