PERFORCE change 102647 for review

Paolo Pisati piso at FreeBSD.org
Fri Jul 28 14:34:39 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=102647

Change 102647 by piso at piso_newluxor on 2006/07/28 14:33:06

	When the list is empty, add the entry at the head.

Affected files ...

.. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_mod.c#17 edit

Differences ...

==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_mod.c#17 (text+ko) ====

@@ -168,7 +168,7 @@
 
 static int
 _attach_handler(struct proto_handler *p) {
-	struct proto_handler *b;
+	struct proto_handler *b = NULL;
 
 	LIBALIAS_WLOCK_ASSERT();	
 	LIST_FOREACH(b, &handler_chain, entries) {
@@ -182,7 +182,10 @@
 		}
 	}
 	/* End of list or found right position, inserts here. */
-	LIST_INSERT_AFTER(b, p, entries);
+	if (b)
+		LIST_INSERT_AFTER(b, p, entries);
+	else
+		LIST_INSERT_HEAD(&handler_chain, p, entries);
 	return (0);
 }
 


More information about the p4-projects mailing list