Blame SOURCES/memstomp-quietmode.patch

a9fe34
diff -Nrup a/memstomp.c b/memstomp.c
a9fe34
--- a/memstomp.c	2013-05-30 06:02:56.578486389 -0600
a9fe34
+++ b/memstomp.c	2013-05-30 06:06:42.648731070 -0600
a9fe34
@@ -64,6 +64,8 @@
a9fe34
 
a9fe34
 static bool abrt_trap = false;
a9fe34
 
a9fe34
+static bool quiet_mode = false;
a9fe34
+
a9fe34
 #ifndef SCHED_RESET_ON_FORK
a9fe34
 /* "Your libc lacks the definition of SCHED_RESET_ON_FORK. We'll now
a9fe34
  * define it ourselves, however make sure your kernel is new
a9fe34
@@ -162,7 +164,10 @@ static void setup(void) {
a9fe34
         if (LIKELY(initialized))
a9fe34
                 return;
a9fe34
 
a9fe34
-        if (!dlsym(NULL, "main"))
a9fe34
+        if (getenv("MEMSTOMP_QUIET"))
a9fe34
+                quiet_mode = true;
a9fe34
+
a9fe34
+        if (!dlsym(NULL, "main") && !quiet_mode)
a9fe34
                 fprintf(stderr,
a9fe34
                         "memstomp: Application appears to be compiled without -rdynamic. It might be a\n"
a9fe34
                         "memstomp: good idea to recompile with -rdynamic enabled since this produces more\n"
a9fe34
@@ -173,9 +178,11 @@ static void setup(void) {
a9fe34
 
a9fe34
         initialized = true;
a9fe34
 
a9fe34
-	char prname[17];
a9fe34
-        fprintf(stderr, "memstomp: "PACKAGE_VERSION" successfully initialized for process %s (pid %lu).\n",
a9fe34
-                get_prname(prname), (unsigned long) getpid());
a9fe34
+        if (!quiet_mode) {
a9fe34
+                char prname[17];
a9fe34
+                fprintf(stderr, "memstomp: "PACKAGE_VERSION" successfully initialized for process %s (pid %lu).\n",
a9fe34
+                        get_prname(prname), (unsigned long) getpid());
a9fe34
+        }
a9fe34
 }
a9fe34
 
a9fe34
 static void show_summary(void) { }
a9fe34
diff -Nrup a/memstomp.in b/memstomp.in
a9fe34
--- a/memstomp.in	2011-03-30 21:27:19.000000000 -0600
a9fe34
+++ b/memstomp.in	2013-05-30 06:06:42.649731067 -0600
a9fe34
@@ -18,7 +18,7 @@
a9fe34
 # You should have received a copy of the GNU Lesser General Public
a9fe34
 # License along with memstomp. If not, see <http://www.gnu.org/licenses/>.
a9fe34
 
a9fe34
-if ! TEMP=`getopt -o +dhk --long help,debug-info,kill -n memstomp -- "$@"` ; then
a9fe34
+if ! TEMP=`getopt -o +dqhk --long help,quiet,debug-info,kill -n memstomp -- "$@"` ; then
a9fe34
     exit 1
a9fe34
 fi
a9fe34
 
a9fe34
@@ -38,6 +38,10 @@ while : ; do
a9fe34
                         shift 1
a9fe34
                         ;;
a9fe34
 
a9fe34
+                -q|--quiet)
a9fe34
+                        export MEMSTOMP_QUIET=1
a9fe34
+                        shift 1
a9fe34
+                        ;;
a9fe34
 
a9fe34
                 -h|--help)
a9fe34
                         cat <
a9fe34
@@ -51,6 +55,7 @@ COMMANDS:
a9fe34
 OPTIONS:
a9fe34
   -d, --debug-info                Make use of debug information in stack traces
a9fe34
   -k, --kill                      Kill application when problem memcpy occurs
a9fe34
+  -q, --quiet                     Be less verbose
a9fe34
 EOF
a9fe34
                         exit 0
a9fe34
                         ;;
a9fe34
diff -Nrup a/memstomp.man b/memstomp.man
a9fe34
--- a/memstomp.man	2013-05-30 06:02:56.577486392 -0600
a9fe34
+++ b/memstomp.man	2013-05-30 06:06:18.531812637 -0600
a9fe34
@@ -47,6 +47,9 @@ Kill the analyzed application when a pro
a9fe34
 .TP
a9fe34
 .BR \-h ", " \-\-help
a9fe34
 Display usage information and exit.
a9fe34
+.TP
a9fe34
+.BR \-q ", " \-\-quiet
a9fe34
+Be less verbose
a9fe34
 .SH SEE ALSO
a9fe34
 .BR memcpy (3),
a9fe34
 .BR memccpy (3),