Lines Matching refs:mtd_fd
103 int mtd_fd = -1;
133 if ((mtd_fd = confmtd_open("confmtd", O_RDWR)) < 0 ||
134 ioctl(mtd_fd, MEMGETINFO, &mtd_info) != 0) {
188 (void) ioctl(mtd_fd, MEMUNLOCK, &erase_info);
189 if (ioctl(mtd_fd, MEMERASE, &erase_info) != 0 ||
190 write(mtd_fd, buf, (sizeof(confmtd_hdr_t) + tmp_stat.st_size)) !=
206 if (mtd_fd >= 0)
207 close(mtd_fd);
229 int mtd_fd = -1;
258 if ((mtd_fd = confmtd_open("confmtd", O_RDWR)) < 0 ||
259 ioctl(mtd_fd, MEMGETINFO, &mtd_info) != 0) {
264 if (read(mtd_fd, &mtd_hdr, sizeof(confmtd_hdr_t)) == -1) {
284 if (read(mtd_fd, buf, mtd_hdr.len) == -1) {
312 if (mtd_fd >= 0)
313 close(mtd_fd);