public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] tools: mkimage can read input on /dev/stdin
@ 2014-09-26 19:33 Julien Castets
  2014-09-27 12:54 ` Wolfgang Denk
  0 siblings, 1 reply; 14+ messages in thread
From: Julien Castets @ 2014-09-26 19:33 UTC (permalink / raw)
  To: u-boot

Hi,

I would like to give /dev/stdin to the flag -d of mkimage. The only
thing that prevent doing it is the function copy_file of mkimage.c,
which:
- calls stat(2) on the file to get the input file size
- calls mmap(2) with this size as length

When the file is a pipe, its size is set to 0 and mmap(2) fails.

This patch replaces the use of mmap(2) with read(2). If accepted, I
could give a look to accept /dev/stdout as output file (which is
currently also required to be a file).

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-09-28 17:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-26 19:33 [U-Boot] [PATCH] tools: mkimage can read input on /dev/stdin Julien Castets
2014-09-27 12:54 ` Wolfgang Denk
2014-09-27 13:11   ` Julien Castets
2014-09-27 13:25     ` Wolfgang Denk
2014-09-27 17:28       ` Julien Castets
2014-09-27 18:24         ` Wolfgang Denk
2014-09-27 19:06           ` Julien Castets
2014-09-27 21:56             ` Wolfgang Denk
2014-09-27 22:01               ` Marek Vasut
2014-09-27 22:21                 ` Wolfgang Denk
2014-09-28  0:16               ` Julien Castets
2014-09-28  6:49                 ` Wolfgang Denk
2014-09-28 10:49                   ` Julien Castets
2014-09-28 17:48                     ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox