netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Limit SO_BSDCOMPAT warning
@ 2003-10-24 20:57 Andi Kleen
  2003-10-25  2:37 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Andi Kleen @ 2003-10-24 20:57 UTC (permalink / raw)
  To: netdev; +Cc: davem


Warning a few times for each process is enough.

-Andi

diff -u linux-2.6.0test7/net/core/sock.c-o linux-2.6.0test7mm1-averell/net/core/sock.c
--- linux-2.6.0test7mm1/net/core/sock.c-o	2003-10-16 05:19:13.000000000 +0200
+++ linux-2.6.0test7mm1/net/core/sock.c	2003-10-24 22:30:46.000000000 +0200
@@ -154,8 +154,14 @@
 
 static void sock_warn_obsolete_bsdism(const char *name)
 {
-	printk(KERN_WARNING "process `%s' is using obsolete "
-	       "%s SO_BSDCOMPAT\n", current->comm, name);
+	static int warned;
+	static char warncomm[16];
+	if (strcmp(warncomm, current->comm) && warned < 5) { 
+		strcpy(warncomm,  current->comm); 
+		printk(KERN_WARNING "process `%s' is using obsolete "
+		       "%s SO_BSDCOMPAT\n", warncomm, name);
+		warned++;
+	}
 }
 
 /*

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Limit SO_BSDCOMPAT warning
  2003-10-24 20:57 [PATCH] Limit SO_BSDCOMPAT warning Andi Kleen
@ 2003-10-25  2:37 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2003-10-25  2:37 UTC (permalink / raw)
  To: Andi Kleen; +Cc: netdev

On Fri, 24 Oct 2003 22:57:07 +0200
Andi Kleen <ak@muc.de> wrote:

> Warning a few times for each process is enough.

Ok, I'll apply this.  I like this version of a patch limiting this
message, compared to the others that have been submitted, because it
still ensures that every program that has the problem will show up at
least one time in the logs.

Thanks Andi.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-10-25  2:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-24 20:57 [PATCH] Limit SO_BSDCOMPAT warning Andi Kleen
2003-10-25  2:37 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).