PERFORCE change 100762 for review
Paolo Pisati
piso at FreeBSD.org
Thu Jul 6 15:55:47 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=100762
Change 100762 by piso at piso_newluxor on 2006/07/06 15:55:33
Some more style(9) fixes: indentation, white space and
comments.
Affected files ...
.. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#8 edit
.. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_mod.c#15 edit
Differences ...
==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#8 (text+ko) ====
@@ -1504,7 +1504,8 @@
while (1) {
fgets(buf, 256, fd);
- if feof(fd) break;
+ if feof(fd)
+ break;
len = strlen(buf);
if (len > 1) {
buf[len - 1] = '\0';
==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_mod.c#15 (text+ko) ====
@@ -61,7 +61,7 @@
#include <sys/types.h>
-/* protocol and userland module handlers chains */
+/* Protocol and userland module handlers chains. */
LIST_HEAD(handler_chain, proto_handler) handler_chain = LIST_HEAD_INITIALIZER(foo);
#ifdef _KERNEL
struct rwlock handler_rw;
@@ -172,15 +172,16 @@
LIBALIAS_WLOCK_ASSERT();
LIST_FOREACH(b, &handler_chain, entries) {
- if ((b->pri == p->pri) && (b->dir == p->dir) &&
- (b->proto == p->proto))
- return (EEXIST); /* priority conflict */
+ if ((b->pri == p->pri) &&
+ (b->dir == p->dir) &&
+ (b->proto == p->proto))
+ return (EEXIST); /* Priority conflict. */
if (b->pri > p->pri) {
LIST_INSERT_BEFORE(b, p, entries);
return (0);
}
}
- /* end of list or got right position, insert here */
+ /* End of list or found right position, inserts here. */
LIST_INSERT_AFTER(b, p, entries);
return (0);
}
@@ -196,7 +197,7 @@
return (0);
}
}
- return (ENOENT); /* handler not found */
+ return (ENOENT); /* Handler not found. */
}
int
@@ -205,9 +206,11 @@
LIBALIAS_WLOCK();
for (i=0; 1; i++) {
- if (*((int *)&_p[i]) == EOH) break;
+ if (*((int *)&_p[i]) == EOH)
+ break;
error = _attach_handler(&_p[i]);
- if (error != 0) break;
+ if (error != 0)
+ break;
}
LIBALIAS_WUNLOCK();
return (error);
@@ -219,9 +222,11 @@
LIBALIAS_WLOCK();
for (i=0; 1; i++) {
- if (*((int *)&_p[i]) == EOH) break;
+ if (*((int *)&_p[i]) == EOH)
+ break;
error = _detach_handler(&_p[i]);
- if (error != 0) break;
+ if (error != 0)
+ break;
}
LIBALIAS_WUNLOCK();
return (error);
@@ -238,7 +243,8 @@
}
int
-find_handler(int8_t dir, int8_t proto, struct libalias *la, struct ip *pip, struct alias_data *ad) {
+find_handler(int8_t dir, int8_t proto, struct libalias *la, struct ip *pip,
+ struct alias_data *ad) {
struct proto_handler *p;
int error = ENOENT;
@@ -261,7 +267,7 @@
return (LIST_FIRST(&handler_chain));
}
-/* dll manipulation code - this code is not thread safe... */
+/* Dll manipulation code - this code is not thread safe... */
int
attach_dll(struct dll *p) {
@@ -269,9 +275,8 @@
SLIST_FOREACH(b, &dll_chain, next) {
if (!strncmp(b->name, p->name, DLL_LEN))
- return (EEXIST); /* dll name conflict */
+ return (EEXIST); /* Dll name conflict. */
}
- /* end of list, insert here */
SLIST_INSERT_HEAD(&dll_chain, p, next);
return (0);
}
More information about the p4-projects
mailing list