On 11-05-24 10:24 PM, DRC wrote:
This belongs in __vgl_fakerinit().

Heh, where it was till I didn't like the line

  [VGL] Shared memory segment ID for vglconfig: 510853141

always getting printed first. The attached patch achieves this instead by not printing the shared memory segment line till __vgl_fakerinit().

Again, not a simple one-liner to achieve this:

   [VGL] VirtualGL v2.2.80 64-bit (Build 20110524)
   [VGL] Shared memory segment ID for vglconfig: 510853141

instead of:

   [VGL] Shared memory segment ID for vglconfig: 510853141
   [VGL] VirtualGL v2.2.80 64-bit (Build 20110524)

-Nathan
>From 1fd697803c595b6d7bc1c826c03b1d6486cc8c40 Mon Sep 17 00:00:00 2001
From: Nathan Kidd <nk...@opentext.com>
Date: Wed, 25 May 2011 10:25:30 -0400
Subject: [PATCH] Print version information in verbose mode

---
 rr/faker.cpp       |   10 ++++++++++
 rr/fakerconfig.cpp |    5 -----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/rr/faker.cpp b/rr/faker.cpp
index a2a9184..64559f7 100644
--- a/rr/faker.cpp
+++ b/rr/faker.cpp
@@ -216,6 +216,16 @@ void __vgl_fakerinit(void)
 	fconfig_reloadenv();
 	if(strlen(fconfig.log)>0) rrout.logto(fconfig.log);
 
+	if(fconfig.verbose)
+		rrout.println("[VGL] %s v%s %d-bit (Build %s)",
+			__APPNAME, __VERSION, (int)sizeof(size_t)*8, __BUILD);
+
+	#if FCONFIG_USESHM==1
+	if(fconfig.verbose)
+		rrout.println("[VGL] Shared memory segment ID for vglconfig: %d",
+			fconfig_getshmid());
+	#endif
+
 	#ifdef __DEBUG__
 	if(getenv("VGL_DEBUG"))
 	{
diff --git a/rr/fakerconfig.cpp b/rr/fakerconfig.cpp
index 213ea86..220bd53 100644
--- a/rr/fakerconfig.cpp
+++ b/rr/fakerconfig.cpp
@@ -95,11 +95,6 @@ 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))
-				rrout.println("[VGL] Shared memory segment ID for vglconfig: %d",
-					fc_shmid);
 			fc=(FakerConfig *)addr;
 
 			#else
-- 
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