devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dtc: Show the usage text if no parameter is passed
@ 2017-10-18 23:28 Fabio Estevam
       [not found] ` <1508369307-22307-1-git-send-email-festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2017-10-18 23:28 UTC (permalink / raw)
  To: david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+
  Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA, Fabio Estevam

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.

Signed-off-by: Fabio Estevam <fabio.estevam-3arQi8VN3Tc@public.gmane.org>
---
 dtc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dtc.c b/dtc.c
index 5ed873c..6308a63 100644
--- a/dtc.c
+++ b/dtc.c
@@ -269,6 +269,8 @@ int main(int argc, char *argv[])
 		}
 	}
 
+	if (argc == 1)
+		usage(NULL);
 	if (argc > (optind+1))
 		usage("missing files");
 	else if (argc < (optind+1))
-- 
2.7.4

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

end of thread, other threads:[~2017-10-19  2:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).