Lines Matching refs:fd
51 int fd; in boot_info_open_partition() local
93 fd = open(path, flags); in boot_info_open_partition()
97 if (fd != -1 && out_size != NULL) { in boot_info_open_partition()
98 if (ioctl(fd, BLKGETSIZE64, out_size) != 0) { in boot_info_open_partition()
99 close(fd); in boot_info_open_partition()
104 return fd; in boot_info_open_partition()
125 int fd; in boot_info_load() local
129 fd = boot_info_open_partition("misc", NULL, O_RDONLY); in boot_info_load()
130 if (fd == -1) in boot_info_load()
132 if (lseek(fd, BOOTINFO_OFFSET, SEEK_SET) != BOOTINFO_OFFSET) { in boot_info_load()
133 close(fd); in boot_info_load()
138 num_read = read(fd, (void*) out_info, sizeof(BrilloBootInfo)); in boot_info_load()
140 close(fd); in boot_info_load()
148 int fd; in boot_info_save() local
150 fd = boot_info_open_partition("misc", NULL, O_RDWR); in boot_info_save()
151 if (fd == -1) in boot_info_save()
153 if (lseek(fd, BOOTINFO_OFFSET, SEEK_SET) != BOOTINFO_OFFSET) { in boot_info_save()
154 close(fd); in boot_info_save()
159 num_written = write(fd, (void*) info, sizeof(BrilloBootInfo)); in boot_info_save()
161 close(fd); in boot_info_save()