Пример #1
0
static int
boot_vect_read_one(struct image_version *ver, const char *path)
{
    uint32_t bytes_read;
    int rc;

    rc = nffsutil_read_file(path, 0, sizeof *ver, ver, &bytes_read);
    if (rc != 0 || bytes_read != sizeof *ver) {
        return BOOT_EBADVECT;
    }

    return 0;
}
Пример #2
0
int
tr_io_read(const char *path, void *out_data, size_t len, size_t *out_len)
{
    uint32_t u32;
    int rc;

    rc = nffsutil_read_file(path, 0, len, out_data, &u32);
    if (rc != 0) {
        return -1;
    }

    *out_len = u32;

    return 0;
}