[Crosstoolchain-logs] [device-tree-compiler] 83/198: util_version: new helper for displaying version info
Hector Oron
zumbi at moszumanska.debian.org
Thu Dec 8 17:06:56 UTC 2016
This is an automated email from the git hooks/post-receive script.
zumbi pushed a commit to branch upstream/1.4.x
in repository device-tree-compiler.
commit 31be4ce7ca550a6fd9c4eb39abdd2f9f5ac8db44
Author: Mike Frysinger <vapier at gentoo.org>
Date: Wed Apr 10 14:29:09 2013 -0400
util_version: new helper for displaying version info
This is so all utilities can have this flag and not just dtc.
Acked-by: David Gibson <david at gibson.dropbear.id.au>
Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
dtc.c | 5 +----
util.c | 7 +++++++
util.h | 5 +++++
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/dtc.c b/dtc.c
index d40e220..e4e1b84 100644
--- a/dtc.c
+++ b/dtc.c
@@ -21,8 +21,6 @@
#include "dtc.h"
#include "srcpos.h"
-#include "version_gen.h"
-
/*
* Command line options
*/
@@ -158,8 +156,7 @@ int main(int argc, char *argv[])
srcfile_add_search_path(optarg);
break;
case 'v':
- printf("Version: %s\n", DTC_VERSION);
- exit(0);
+ util_version();
case 'H':
if (streq(optarg, "legacy"))
phandle_format = PHANDLE_LEGACY;
diff --git a/util.c b/util.c
index c689ea7..a9b118c 100644
--- a/util.c
+++ b/util.c
@@ -34,6 +34,7 @@
#include "libfdt.h"
#include "util.h"
+#include "version_gen.h"
char *xstrdup(const char *s)
{
@@ -374,3 +375,9 @@ void utilfdt_print_data(const char *data, int len)
printf("]");
}
}
+
+void util_version(void)
+{
+ printf("Version: %s\n", DTC_VERSION);
+ exit(0);
+}
diff --git a/util.h b/util.h
index d856eb9..e09cc25 100644
--- a/util.h
+++ b/util.h
@@ -168,4 +168,9 @@ int utilfdt_decode_type(const char *fmt, int *type, int *size);
*/
void utilfdt_print_data(const char *data, int len);
+/**
+ * Show source version and exit
+ */
+void util_version(void) __attribute__((noreturn));
+
#endif /* _UTIL_H */
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/crosstoolchain/device-tree-compiler.git
More information about the Crosstoolchain-logs
mailing list