[PATCH:xfsinfo] Print normalized version for X.Org servers, the way xdpyinfo does

Alan Coopersmith alan.coopersmith at oracle.com
Sat Jan 12 18:06:01 PST 2013


Results in output like:
vendor string:    X.Org Foundation
vendor release number:  10102000
X.Org xfs version: 1.1.2

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 xfsinfo.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xfsinfo.c b/xfsinfo.c
index c98c5a4..d847f85 100644
--- a/xfsinfo.c
+++ b/xfsinfo.c
@@ -121,6 +121,17 @@ print_server_info(FSServer *svr)
     printf("version number:	%d\n", FSProtocolVersion(svr));
     printf("vendor string:	%s\n", FSServerVendor(svr));
     printf("vendor release number:	%d\n", FSVendorRelease(svr));
+    if (strstr(FSServerVendor(svr), "X.Org")) {
+	int vendrel = FSVendorRelease(svr);
+
+	printf("X.Org xfs version: ");
+	printf("%d.%d.%d", vendrel / 10000000,
+	       (vendrel /   100000) % 100,
+	       (vendrel /     1000) % 100);
+	if (vendrel % 1000)
+	    printf(".%d", vendrel % 1000);
+	printf("\n");
+    }
     printf("maximum request size:	%ld longwords (%ld bytes)\n",
 	   FSMaxRequestSize(svr), FSMaxRequestSize(svr) * sizeof(long));
     print_catalogue_info(svr);
-- 
1.7.9.2



More information about the xorg-devel mailing list