Even if the user is competent, the number of ways one could accidentally load a different librrfaker.so make this information invaluable.

This isn't a one-liner to gain the aesthetic of printing the version info first, before anything else.

-Nathan
>From b3c6ca4d4cfa9f60e149bca4f68f6460c01b3008 Mon Sep 17 00:00:00 2001
From: Nathan Kidd <nk...@opentext.com>
Date: Tue, 24 May 2011 16:38:26 -0400
Subject: [PATCH] Print version information in verbose mode

---
 rr/fakerconfig.cpp |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/rr/fakerconfig.cpp b/rr/fakerconfig.cpp
index 213ea86..a18d013 100644
--- a/rr/fakerconfig.cpp
+++ b/rr/fakerconfig.cpp
@@ -85,6 +85,13 @@ FakerConfig *fconfig_instance(void)
 		rrcs::safelock l(fcmutex);
 		if(fc==NULL) 
 		{
+			char *env=NULL;
+			bool verbose=((env=getenv("VGL_VERBOSE"))!=NULL && strlen(env)>0
+					&& !strncmp(env, "1", 1));
+			if(verbose)
+				rrout.println("[VGL] %s v%s %d-bit (Build %s)",
+					__APPNAME, __VERSION, (int)sizeof(size_t)*8, __BUILD);
+
 			#if FCONFIG_USESHM==1
 
 			void *addr=NULL;
@@ -95,9 +102,7 @@ FakerConfig *fconfig_instance(void)
 			#ifdef linux
 			shmctl(fc_shmid, IPC_RMID, 0);
 			#endif
-			char *env=NULL;
-			if((env=getenv("VGL_VERBOSE"))!=NULL && strlen(env)>0
-				&& !strncmp(env, "1", 1))
+			if (verbose)
 				rrout.println("[VGL] Shared memory segment ID for vglconfig: %d",
 					fc_shmid);
 			fc=(FakerConfig *)addr;
-- 
1.6.3.3

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
VirtualGL-Devel mailing list
VirtualGL-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtualgl-devel

Reply via email to