]> granicus.if.org Git - procps-ng/commitdiff
ps: add build option to disable ps option warning
authorunknown <unknown@example.com>
Mon, 5 Dec 2011 15:35:35 +0000 (16:35 +0100)
committerCraig Small <csmall@enc.com.au>
Sat, 17 Dec 2011 23:53:44 +0000 (10:53 +1100)
Slackware seems to have this patch, while it is not in use(?) Well,
the upstream procps-ng allows one to disable warnings if that is
wanted. After all having this sort of 'feature' does not cost much,
while lacking it might annoy someone.

A patch from Slackware.

Reference: http://www.ftp.be/packages/slackware/slackware_source/a/procps/procps.nowarning.diff.gz
Backported-by: Sami Kerola <kerolasa@iki.fi>
Conflicts:

proc/ksym.c

configure.ac
proc/ksym.c
ps/parser.c

index 7b6bd66843e1ae51fb7b5605a9ea6b109c959bdb..7be64c2abbfbe306ce24dbace4d538a183dd3a36 100644 (file)
@@ -136,6 +136,14 @@ if test "x$enable_w_from" = xyes; then
   AC_DEFINE(W_SHOWFROM, 1, [enable w from field by default])
 fi
 
+AC_ARG_ENABLE([whining],
+  AS_HELP_STRING([--disable-whining], [do not print unnessary warnings (slackware-ism)]),
+  [], enable_whining=yes
+)
+if test "x$enable_whining" = xyes; then
+  AC_DEFINE(BUILD_WITH_WHINE, 1, [should extra warnings be printed (slackware-ism)])
+fi
+
 if test x"$DEJAGNU" = x                                                        
 then                                                                           
   DEJAGNU="\$(top_srcdir)/testsuite/global-conf.exp"                         
index 1e10f72f67fc7d1e175526897ef05b54d3301129..ceddba134694f6b10b1aeb67d7d734d7b136eed3 100644 (file)
@@ -418,18 +418,26 @@ good_match:;
     }
   }
 
+#ifdef BUILD_WITH_WHINE
   if(0){
 bad_match:
     message("Warning: %s does not match kernel data.\n", filename);
   }
+#endif
   if(0){
 bad_version:
     message("Warning: %s has an incorrect kernel version.\n", filename);
   }
   if(0){
+bad_alloc:
+    message("Warning: not enough memory available\n");
+  }
+#ifdef BUILD_WITH_WHINE
+  if(0){
 bad_parse:
     message("Warning: %s not parseable as a System.map\n", filename);
   }
+#endif
   if(0){
 bad_open:
     message("Warning: %s could not be opened as a System.map\n", filename);
index 4fa8e4adad5ed0d4a94c084f4f2b08698535122d..1edd26ed3bf5ba09d5eb17fa9b344349b2f70f57 100644 (file)
@@ -1231,8 +1231,19 @@ try_bsd:
   // for some non-default personalities. So "ps -ax" will parse
   // as SysV options... and you're screwed if you've been patching
   // out the friendly warning. Cut-over is likely to be in 2005.
+#ifdef BUILD_WITH_WHINE
+  // Slackware:
+  //   IMO, people can change old habits if and when user 'x' comes
+  //   along.  I still find this warning to be a POLA violation.  No
+  //   offense...  that's the beauty of open source.  You've got your
+  //   ideas about this, and I have mine, and we're allowed to
+  //   disagree.  Nothing in the UNIX or POSIX standards requires
+  //   this (annoying) warning to be displayed, and we're not
+  //   changing the actual behavior of ps in any way.  I know of no
+  //   other 'ps' that produces this message.
   if(!(personality & PER_FORCE_BSD))
     fprintf(stderr, "Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html\n");
+#endif
   // Remember: contact procps@freelists.org
   // if you should feel tempted. Be damn sure you understand all
   // the issues. The same goes for other stuff too, BTW. Please ask.