PERFORCE change 166967 for review

Edward Tomasz Napierala trasz at FreeBSD.org
Mon Aug 3 16:04:44 UTC 2009


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

Change 166967 by trasz at trasz_anger on 2009/08/03 16:03:56

	Add some documentation.

Affected files ...

.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_hrl.c#40 edit
.. //depot/projects/soc2009/trasz_limits/usr.sbin/hrl/Makefile#4 edit
.. //depot/projects/soc2009/trasz_limits/usr.sbin/hrl/hrl.c#21 edit

Differences ...

==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_hrl.c#40 (text+ko) ====

@@ -1338,6 +1338,12 @@
 				free(buf, M_HRL);
 				goto again;
 			}
+			/*
+			 * Non-process rules will be added to the buffer later.
+			 * Adding them here would result in duplicated output.
+			 */
+			if (limit->hl_rule->hr_subject != HRL_SUBJECT_PROCESS)
+				continue;
 			if (!hrl_rule_matches(limit->hl_rule, filter))
 				continue;
 			*(buf + copied) = *limit->hl_rule;

==== //depot/projects/soc2009/trasz_limits/usr.sbin/hrl/Makefile#4 (text+ko) ====

@@ -1,7 +1,7 @@
 # $FreeBSD$
 
 PROG=   hrl
-MAN=
+MAN=	hrl.8
 
 WARNS?=	6
 

==== //depot/projects/soc2009/trasz_limits/usr.sbin/hrl/hrl.c#21 (text+ko) ====

@@ -203,14 +203,14 @@
 }
 
 static void
-remove_rule(char *rule)
+remove_rule(char *filter)
 {
 	int error;
 
-	error = hrl_remove_rule(rule, strlen(rule) + 1, NULL, 0);
+	error = hrl_remove_rule(filter, strlen(filter) + 1, NULL, 0);
 	if (error)
 		err(1, "hrl_remove_rule");
-	free(rule);
+	free(filter);
 }
 
 /*
@@ -278,7 +278,7 @@
 usage(void)
 {
 
-	fprintf(stderr, "usage: hrl [-a rule | -l filter | -r rule | -u filter | filter]\n");
+	fprintf(stderr, "usage: hrl [-a rule | -l filter | -r filter | -u filter | filter]\n");
 	exit(1);
 }
 


More information about the p4-projects mailing list