Blame SOURCES/memstomp-quietmode.patch

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