Esempio n. 1
0
static struct cpio_header *mapheader(struct service_backend *backend, struct service_state *state, unsigned int id)
{

    struct cpio_header *header = (struct cpio_header *)backend->map(state, id, sizeof (struct cpio_header));

    return (cpio_validate(header)) ? header : 0;

}
Esempio n. 2
0
static unsigned int readheader(struct service_backend *backend, struct cpio_header *header, unsigned int id)
{

    unsigned int count = backend->read(header, sizeof (struct cpio_header), id);

    return (count == sizeof (struct cpio_header)) ? cpio_validate(header) : 0;

}