| 499 | } |
| 500 | |
| 501 | FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir, FilePath* path) { |
| 502 | int fd = CreateAndOpenFdForTemporaryFile(dir, path); |
| 503 | if (fd < 0) |
| 504 | return NULL; |
| 505 | |
| 506 | FILE* file = fdopen(fd, "a+"); |
| 507 | if (!file) |
| 508 | close(fd); |
| 509 | return file; |
| 510 | } |
| 511 | |
| 512 | bool CreateTemporaryFileInDir(const FilePath& dir, FilePath* temp_file) { |
| 513 | ThreadRestrictions::AssertIOAllowed(); // For call to close(). |
no test coverage detected