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

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



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.

Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe devicetree-compiler" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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