From 61a12066abe34c8a073033c8a03bd9d62a69c7b4 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sun, 3 Jul 2005 00:57:25 +0000 Subject: [PATCH] Fix for EXDEV temp file across 2 filesystems problem #1231495 --- config.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config.c b/config.c index c70fe7d..868ff8f 100644 --- a/config.c +++ b/config.c @@ -40,6 +40,9 @@ int Config::init(char* takeFileName) } strcpy(fileName, takeFileName); + strcpy(fileNameTemp, takeFileName); + strcat(fileNameTemp, ".tmp"); + file = fopen(fileName, "r"); if (!file) { @@ -118,9 +121,7 @@ int Config::readLine() FILE* Config::copyToHere(long position) { - strcpy(fileNameTemp, "/tmp/configXXXXXX"); - int newFileDes = mkstemp(fileNameTemp); - FILE* newFile = fdopen(newFileDes, "w"); + FILE* newFile = fopen(fileNameTemp, "w"); if (!newFile) return NULL; -- 2.39.5