| 59 | } |
| 60 | |
| 61 | static int do_file(char *name, size_t *size, int oflag) |
| 62 | { |
| 63 | struct stat fd_stat; |
| 64 | int fd; |
| 65 | |
| 66 | fd = open(name, oflag, 0666); |
| 67 | if (fd < 0) |
| 68 | return -1; |
| 69 | |
| 70 | if (fstat(fd, &fd_stat)) { |
| 71 | close(fd); |
| 72 | return -1; |
| 73 | } |
| 74 | |
| 75 | if (size) |
| 76 | *size = fd_stat.st_size; |
| 77 | return fd; |
| 78 | } |
| 79 | |
| 80 | static int parse_elf_to_xip_ram(const struct buffer *input, |
| 81 | struct buffer *output) |
no outgoing calls
no test coverage detected