| 1 |
diff -urp ElectricFence-2.2.2/efence.c ElectricFence-2.2.2-pm/efence.c
|
| 2 |
--- ElectricFence-2.2.2/efence.c 2007-03-28 20:16:43.000000000 +0200
|
| 3 |
+++ ElectricFence-2.2.2-pm/efence.c 2007-03-28 20:16:01.000000000 +0200
|
| 4 |
@@ -47,7 +47,7 @@
|
| 5 |
#undef calloc
|
| 6 |
#endif
|
| 7 |
|
| 8 |
-static const char version[] = "\n Electric Fence 2.2.0"
|
| 9 |
+static const char version[] = "\n Electric Fence 2.2.2"
|
| 10 |
" Copyright (C) 1987-1999 Bruce Perens <bruce@perens.com>\n";
|
| 11 |
|
| 12 |
/*
|
| 13 |
@@ -82,6 +82,13 @@ struct _Slot {
|
| 14 |
};
|
| 15 |
typedef struct _Slot Slot;
|
| 16 |
|
| 17 |
+ /*
|
| 18 |
+ * EF_DISABLE_BANNER is a global variable used to control whether
|
| 19 |
+ * Electric Fence prints its usual startup message. If the value is
|
| 20 |
+ * -1, it will be set from the environment default to 0 at run time.
|
| 21 |
+ */
|
| 22 |
+int EF_DISABLE_BANNER = -1;
|
| 23 |
+
|
| 24 |
/*
|
| 25 |
* EF_ALIGNMENT is a global variable used to control the default alignment
|
| 26 |
* of buffers returned by malloc(), calloc(), and realloc(). It is all-caps
|
| 27 |
@@ -280,7 +287,15 @@ initialize(void)
|
| 28 |
char * string;
|
| 29 |
Slot * slot;
|
| 30 |
|
| 31 |
- EF_Print(version);
|
| 32 |
+ if ( EF_DISABLE_BANNER == -1 ) {
|
| 33 |
+ if ( (string = getenv("EF_DISABLE_BANNER")) != 0 )
|
| 34 |
+ EF_DISABLE_BANNER = atoi(string);
|
| 35 |
+ else
|
| 36 |
+ EF_DISABLE_BANNER = 0;
|
| 37 |
+ }
|
| 38 |
+
|
| 39 |
+ if ( EF_DISABLE_BANNER == 0 )
|
| 40 |
+ EF_Print(version);
|
| 41 |
|
| 42 |
#ifdef USE_SEMAPHORE
|
| 43 |
if (sem_init != NULL && !pthread_initialization && sem_init(&EF_sem, 0, 1) >= 0) {
|