devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Fabio Estevam <festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Devicetree Compiler
	<devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Fabio Estevam <fabio.estevam-3arQi8VN3Tc@public.gmane.org>
Subject: Re: [PATCH] dtc: Show the usage text if no parameter is passed
Date: Thu, 19 Oct 2017 13:02:23 +1100	[thread overview]
Message-ID: <20171019020223.GW2776@umbus.fritz.box> (raw)
In-Reply-To: <CAOMZO5A3ettpwGVATUL3PF6Hj-3087E93QVLZ0tNgD-BG53MYA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1372 bytes --]

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-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> > On Wed, Oct 18, 2017 at 6:28 PM, Fabio Estevam <festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >> From: Fabio Estevam <fabio.estevam-3arQi8VN3Tc@public.gmane.org>
> >>
> >> 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      parent reply	other threads:[~2017-10-19  2:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-18 23:28 [PATCH] dtc: Show the usage text if no parameter is passed Fabio Estevam
     [not found] ` <1508369307-22307-1-git-send-email-festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-19  0:02   ` Rob Herring
     [not found]     ` <CAL_JsqLi5Jte+7_d1kq-Uka=7nV9foKudQ9w31noA++bvUJWjA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-19  0:38       ` Fabio Estevam
     [not found]         ` <CAOMZO5A3ettpwGVATUL3PF6Hj-3087E93QVLZ0tNgD-BG53MYA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-19  2:02           ` David Gibson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171019020223.GW2776@umbus.fritz.box \
    --to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=fabio.estevam-3arQi8VN3Tc@public.gmane.org \
    --cc=festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).