Bug 472042 - Regression: eclipse -noSplash prints errors if no DISPLAY
is set on Linux 


Change-Id: I64cbc93b33a03d531f76f809a85a2ce7c6fe792b
Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
diff --git a/features/org.eclipse.equinox.executable.feature/library/eclipse.c b/features/org.eclipse.equinox.executable.feature/library/eclipse.c
index 8356ecd..1e7fc20 100644
--- a/features/org.eclipse.equinox.executable.feature/library/eclipse.c
+++ b/features/org.eclipse.equinox.executable.feature/library/eclipse.c
@@ -202,7 +202,6 @@
 static _TCHAR* goVMMsg = _T_ECLIPSE("Start VM: %s\n");
 static _TCHAR* pathMsg = _T_ECLIPSE("%s in your current PATH");
 static _TCHAR* shareMsg = _T_ECLIPSE("No exit data available.");
-static _TCHAR* gtkCheck = _T_ECLIPSE("GTK+ Version Check");
 static _TCHAR* noVMMsg =
 _T_ECLIPSE("A Java Runtime Environment (JRE) or Java Development Kit (JDK)\n\
 must be available in order to run %s. No Java virtual machine\n\
@@ -618,7 +617,12 @@
 
 #ifndef _WIN32
 #ifndef MACOSX
-    displayMessage( officialName, gtkCheck );
+    if ((!suppressErrors) && (!noSplash)) {
+	char *display = getenv("DISPLAY");
+        if (display != NULL) {
+            initWindowSystem( &argc, argv, 1);
+        }
+    }
 #endif
 #endif
 	/* the startup jarFile goes on the classpath */
diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkCommon.c b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkCommon.c
index 06bed2a..4e7a075 100644
--- a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkCommon.c
+++ b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtkCommon.c
@@ -17,7 +17,6 @@
 #include <locale.h>
 #include <dlfcn.h>
 #include <stdio.h>
-#include <string.h>
 
 #define ECLIPSE_ICON  401
 
@@ -49,14 +48,10 @@
 	
     /* If GTK has not been initialized yet, do it now. */
     if (initWindowSystem( &saveArgc, saveArgv, 1 ) != 0) {
-    	printf("%s:\n%s\n", title, message);
+		printf("%s:\n%s\n", title, message);
     	return;
     }
 
-    if (strcmp( message, _T_ECLIPSE("GTK+ Version Check")) == 0) {
-        return;
-    }
-
   	dialog = gtk.gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
 				   					GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
 				   					"%s", message);