Skip to contentSkip to conversation

Limit SO_BSDCOMPAT warning

PATCH In review Andi Kleen 2 participants 2 messages Oct 24, 2003 – Oct 25, 2003

Subsystems (3)
lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 Limit SO_BSDCOMPAT warning

Warning a few times for each process is enough.

-Andi

net/core/sock.c renamed from net/core/sock.c-o +8 -2
diff -u linux-2.6.0test7/net/core/sock.c-o linux-2.6.0test7mm1-averell/net/core/sock.c
@@ -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++;
+	}
 }
 
 /*
#1 lore raw
Quoted 1 line · On Fri, 24 Oct 2003 22:57:07 +0200 Andi Kleen <[email protected]> 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.