summaryrefslogtreecommitdiffstats
path: root/base/file_util_posix.cc
diff options
context:
space:
mode:
authordumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 20:06:27 +0000
committerdumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 20:06:27 +0000
commit6445c40fe17dd1d89833ced8495f84d56119221a (patch)
treed5a39404e7a25e4e20b82f12771b44fa925dae28 /base/file_util_posix.cc
parent9a8fd61ff1449d34d8e60b01df2a0c32f0f09b54 (diff)
downloadchromium_src-6445c40fe17dd1d89833ced8495f84d56119221a.zip
chromium_src-6445c40fe17dd1d89833ced8495f84d56119221a.tar.gz
chromium_src-6445c40fe17dd1d89833ced8495f84d56119221a.tar.bz2
Bug fix: produce unique temp file names when the VFS requests a handle to a null file.
BUG=none TEST=none Review URL: http://codereview.chromium.org/194021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26001 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_posix.cc')
-rw-r--r--base/file_util_posix.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index a919b16..0b7763e 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -424,11 +424,10 @@ FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir, FilePath* path) {
return fdopen(fd, "a+");
}
-// TODO(port): implement me.
-bool CreateTemporaryFileInDir(const FilePath& dir,
- FilePath* temp_file) {
- NOTREACHED();
- return false;
+
+bool CreateTemporaryFileInDir(const FilePath& dir, FilePath* temp_file) {
+ int fd = CreateAndOpenFdForTemporaryFile(dir, temp_file);
+ return ((fd >= 0) && !close(fd));
}
bool CreateNewTempDirectory(const FilePath::StringType& prefix,