Re: [PATCH] mtd-utils: allow 'ubiformat' to read from stdin

Artem Bityutskiy
2008-08-26T06:16:56Z

On Mon, 2008-08-25 at 21:09 +0200, Enrico Scholz wrote:
> This patch allows to read the image from stdin and adds an
> '--image-size' option to specify its size. 'upiupdatevol' has this
> feature already and it is useful for 'ubiformat' too.
>
> It adds a read_all() function which reads a block of data. Plain
> 'read(2)' can fail on
>
> nc -l -p 1234 | ubiformat -f - -S 25427968
>
> else.

Applied, pushed, but with few minor tweaks to make the utilities be
uni-styled. Thanks.

> + int fd;
Here I've removed TABs between "int" and "fd", and put a space.

> + ssize_t l = read(fd, buf, len);
And here.

> - struct stat st;
> + off_t st_size;
And here.

--
Best regards,
Artem Bityutskiy (Битюцкий Артём)