summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/android/FileSystemAndroid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/android/FileSystemAndroid.cpp')
-rw-r--r--Source/WebCore/platform/android/FileSystemAndroid.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/WebCore/platform/android/FileSystemAndroid.cpp b/Source/WebCore/platform/android/FileSystemAndroid.cpp
index 9ed43f0..30dc1d3 100644
--- a/Source/WebCore/platform/android/FileSystemAndroid.cpp
+++ b/Source/WebCore/platform/android/FileSystemAndroid.cpp
@@ -55,26 +55,25 @@ CString fileSystemRepresentation(const String& path)
return path.utf8();
}
-CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle)
+String openTemporaryFile(const String& prefix, PlatformFileHandle& handle)
{
int number = rand() % 10000 + 1;
- CString filename;
+ String filename;
do {
StringBuilder builder;
builder.append(sPluginPath);
builder.append('/');
builder.append(prefix);
builder.append(String::number(number));
- filename = builder.toString().utf8();
- const char* fstr = filename.data();
- handle = open(filename.data(), O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+ filename = builder.toString();
+ handle = open(filename.utf8().data(), O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
number++;
if (handle != -1)
return filename;
} while (errno == EEXIST);
- return CString();
+ return String();
}
bool unloadModule(PlatformModule module)