Blame SOURCES/ElectricFence-2.2.2-banner.patch

15f68b
diff -urp ElectricFence-2.2.2/efence.c ElectricFence-2.2.2-pm/efence.c
15f68b
--- ElectricFence-2.2.2/efence.c	2007-03-28 20:16:43.000000000 +0200
15f68b
+++ ElectricFence-2.2.2-pm/efence.c	2007-03-28 20:16:01.000000000 +0200
15f68b
@@ -47,7 +47,7 @@
15f68b
 #undef	calloc
15f68b
 #endif
15f68b
 
15f68b
-static const char	version[] = "\n  Electric Fence 2.2.0"
15f68b
+static const char	version[] = "\n  Electric Fence 2.2.2"
15f68b
  " Copyright (C) 1987-1999 Bruce Perens <bruce@perens.com>\n";
15f68b
 
15f68b
 /*
15f68b
@@ -82,6 +82,13 @@ struct _Slot {
15f68b
 };
15f68b
 typedef struct _Slot	Slot;
15f68b
 
15f68b
+ /*
15f68b
+ * EF_DISABLE_BANNER is a global variable used to control whether
15f68b
+ * Electric Fence prints its usual startup message.  If the value is
15f68b
+ * -1, it will be set from the environment default to 0 at run time.
15f68b
+ */
15f68b
+int		EF_DISABLE_BANNER = -1;
15f68b
+
15f68b
 /*
15f68b
  * EF_ALIGNMENT is a global variable used to control the default alignment
15f68b
  * of buffers returned by malloc(), calloc(), and realloc(). It is all-caps
15f68b
@@ -280,7 +287,15 @@ initialize(void)
15f68b
 	char *	string;
15f68b
 	Slot *	slot;
15f68b
 
15f68b
-	EF_Print(version);
15f68b
+	if ( EF_DISABLE_BANNER == -1 ) {
15f68b
+		if ( (string = getenv("EF_DISABLE_BANNER")) != 0 )
15f68b
+			EF_DISABLE_BANNER = atoi(string);
15f68b
+		else
15f68b
+			EF_DISABLE_BANNER = 0;
15f68b
+	}
15f68b
+
15f68b
+	if ( EF_DISABLE_BANNER == 0 )
15f68b
+		EF_Print(version);
15f68b
 
15f68b
 #ifdef USE_SEMAPHORE
15f68b
 	if (sem_init != NULL && !pthread_initialization && sem_init(&EF_sem, 0, 1) >= 0) {