Re: [PATCH] dtc: Show the usage text if no parameter is passed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Wed, Oct 18, 2017 at 10:38:41PM -0200, Fabio Estevam wrote:
> On Wed, Oct 18, 2017 at 10:02 PM, Rob Herring <robh@xxxxxxxxxx> wrote:
> > On Wed, Oct 18, 2017 at 6:28 PM, Fabio Estevam <festevam@xxxxxxxxx> wrote:
> >> From: Fabio Estevam <fabio.estevam@xxxxxxx>
> >>
> >> When dtc is called without any argument the application hangs forever.
> >>
> >> Instead of hanging, print the usage and exit.
> >
> > I think it is valid to do:
> > dtc < in > out
> >
> > This doesn't hang:
> > $ dtc < /dev/null
> > Error: <stdin>:0.0 syntax error
> > FATAL ERROR: Unable to parse input tree
> 
> These examples do not have argc == 1.

Yes they do.  Everything after the < is processed by the shell and
doesn't appear to dtc as a parameter.

> If 'dtc' is called with no arguments than the application never
> exits.

If dtc is called with no arguments it attempts to read a dts from
standard input and send a dtb to standard output.  It exits when input
finishes.  So, if you press ^D after starting it, it will exit (with
an error, because you haven't put in a valid dts).

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux