Lines Matching refs:fd
110 android::base::unique_fd fd( in SaveFileContents() local
112 if (fd == -1) { in SaveFileContents()
117 if (!android::base::WriteFully(fd, file->data.data(), file->data.size())) { in SaveFileContents()
122 if (fsync(fd) != 0) { in SaveFileContents()
127 if (close(fd.release()) != 0) { in SaveFileContents()
142 android::base::unique_fd fd(open(partition.name.c_str(), O_RDWR)); in WriteBufferToPartition() local
143 if (fd == -1) { in WriteBufferToPartition()
148 if (TEMP_FAILURE_RETRY(lseek(fd, start, SEEK_SET)) == -1) { in WriteBufferToPartition()
153 if (!android::base::WriteFully(fd, data + start, len - start)) { in WriteBufferToPartition()
158 if (fsync(fd) != 0) { in WriteBufferToPartition()
162 if (close(fd.release()) != 0) { in WriteBufferToPartition()
167 fd.reset(open(partition.name.c_str(), O_RDONLY)); in WriteBufferToPartition()
168 if (fd == -1) { in WriteBufferToPartition()
184 if (TEMP_FAILURE_RETRY(lseek(fd, 0, SEEK_SET)) == -1) { in WriteBufferToPartition()
197 if (!android::base::ReadFully(fd, buffer, to_read)) { in WriteBufferToPartition()
215 if (close(fd.release()) != 0) { in WriteBufferToPartition()