Lines Matching refs:dir_fd
34 void HandleError(const std::string& temp_path, int* dir_fd, FILE** fp) { in HandleError() argument
42 if (*dir_fd != -1) { in HandleError()
43 close(*dir_fd); in HandleError()
44 *dir_fd = -1; in HandleError()
123 int dir_fd = open(directory_path.c_str(), O_RDONLY | O_DIRECTORY); in WriteToFile() local
124 if (dir_fd < 0) { in WriteToFile()
132 HandleError(temp_path, &dir_fd, &fp); in WriteToFile()
138 HandleError(temp_path, &dir_fd, &fp); in WriteToFile()
145 HandleError(temp_path, &dir_fd, &fp); in WriteToFile()
158 HandleError(temp_path, &dir_fd, &fp); in WriteToFile()
166 HandleError(temp_path, &dir_fd, &fp); in WriteToFile()
173 HandleError(temp_path, &dir_fd, &fp); in WriteToFile()
178 if (fsync(dir_fd) != 0) { in WriteToFile()
182 if (close(dir_fd) != 0) { in WriteToFile()
184 HandleError(temp_path, &dir_fd, &fp); in WriteToFile()