Blame SOURCES/ElectricFence-2.2.2-banner.patch

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