changeset 577:06675b69ca6c

Add O_TRUNC to configuration file saving flags.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 30 Dec 2012 08:20:47 +0200
parents 414d11df07ce
children c294d9d92bf4
files main.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/main.c	Sun Dec 30 08:12:38 2012 +0200
+++ b/main.c	Sun Dec 30 08:20:47 2012 +0200
@@ -1035,7 +1035,7 @@
 #ifdef __WIN32
     if ((ctx.fp = fopen(setConfigFile, "w")) == NULL)
 #else
-    if ((cfgfd = open(setConfigFile, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR)) == -1 ||
+    if ((cfgfd = open(setConfigFile, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR)) == -1 ||
         (ctx.fp = fdopen(cfgfd, "w")) == NULL)
 #endif
     {