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

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).