diff options
author | tradke <tradke@b32723a9-ab3a-4a60-88e2-2e5d99d7c17a> | 2002-10-31 17:53:04 +0000 |
---|---|---|
committer | tradke <tradke@b32723a9-ab3a-4a60-88e2-2e5d99d7c17a> | 2002-10-31 17:53:04 +0000 |
commit | cc43b1f4fa1a197f757ff260673eb2b74a110c8b (patch) | |
tree | 84a7cb98d72ab917d16b64b0035255769649c7c1 | |
parent | 40849566bd5153c0f169afd7cf1054779208397c (diff) |
Also set O_TRUNC in the flags argument for open(2) so that existing parameter
files are truncated on overwrite.
This closes PR CactusBase-1285.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOUtil/trunk@179 b32723a9-ab3a-4a60-88e2-2e5d99d7c17a
-rw-r--r-- | src/Startup.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Startup.c b/src/Startup.c index 92cd526..618a106 100644 --- a/src/Startup.c +++ b/src/Startup.c @@ -755,7 +755,7 @@ static int CopyParFile (int recovered) else { /* binary-copy the input parfile to the output parfile */ - flags = O_CREAT | O_WRONLY; + flags = O_CREAT | O_TRUNC | O_WRONLY; if (recovered) { flags |= O_EXCL; @@ -861,7 +861,7 @@ static int GenerateParFile (int recovered) } else { - flags = O_CREAT | O_WRONLY; + flags = O_CREAT | O_TRUNC | O_WRONLY; if (recovered) { flags |= O_EXCL; |