Lines Matching refs:temp_path

34 void HandleError(const std::string& temp_path, int* dir_fd, FILE** fp) {  in HandleError()  argument
37 unlink(temp_path.c_str()); in HandleError()
107 const std::string temp_path = path + ".new"; in WriteToFile() local
129 FILE* fp = std::fopen(temp_path.c_str(), "wt"); in WriteToFile()
131 LOG_ERROR("unable to write to file '%s', error: %s", temp_path.c_str(), strerror(errno)); in WriteToFile()
132 HandleError(temp_path, &dir_fd, &fp); in WriteToFile()
137 LOG_ERROR("unable to write to file '%s', error: %s", temp_path.c_str(), strerror(errno)); in WriteToFile()
138 HandleError(temp_path, &dir_fd, &fp); in WriteToFile()
144 …LOG_ERROR("unable to write flush buffer to file '%s', error: %s", temp_path.c_str(), strerror(errn… in WriteToFile()
145 HandleError(temp_path, &dir_fd, &fp); in WriteToFile()
152 LOG_WARN("unable to fsync file '%s', error: %s", temp_path.c_str(), strerror(errno)); in WriteToFile()
157 LOG_ERROR("unable to close file '%s', error: %s", temp_path.c_str(), strerror(errno)); in WriteToFile()
158 HandleError(temp_path, &dir_fd, &fp); in WriteToFile()
164 if (chmod(temp_path.c_str(), S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP) != 0) { in WriteToFile()
165 …LOG_ERROR("unable to change file permissions '%s', error: %s", temp_path.c_str(), strerror(errno)); in WriteToFile()
166 HandleError(temp_path, &dir_fd, &fp); in WriteToFile()
171 if (std::rename(temp_path.c_str(), path.c_str()) != 0) { in WriteToFile()
172 …LOG_ERROR("unable to commit file from '%s' to '%s', error: %s", temp_path.c_str(), path.c_str(), s… in WriteToFile()
173 HandleError(temp_path, &dir_fd, &fp); in WriteToFile()
184 HandleError(temp_path, &dir_fd, &fp); in WriteToFile()