PERFORCE change 186627 for review

Edward Tomasz Napierala trasz at FreeBSD.org
Sat Dec 4 18:10:35 UTC 2010


http://p4web.freebsd.org/@@186627?ac=10

Change 186627 by trasz at trasz_victim on 2010/12/04 18:09:35

	style(9).

Affected files ...

.. //depot/projects/soc2009/trasz_limits/sys/compat/linux/linux_misc.c#17 edit
.. //depot/projects/soc2009/trasz_limits/sys/compat/svr4/imgact_svr4.c#10 edit
.. //depot/projects/soc2009/trasz_limits/sys/i386/linux/imgact_linux.c#9 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/imgact_aout.c#10 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/imgact_elf.c#18 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/imgact_gzip.c#8 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_container.c#39 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_fork.c#25 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_hrl.c#98 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_loginclass.c#21 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_resource.c#53 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/sysv_msg.c#8 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/uipc_sockbuf.c#6 edit
.. //depot/projects/soc2009/trasz_limits/sys/vm/vm_unix.c#10 edit
.. //depot/projects/soc2009/trasz_limits/usr.bin/id/id.c#6 edit
.. //depot/projects/soc2009/trasz_limits/usr.sbin/hrl/hrl.c#27 edit

Differences ...

==== //depot/projects/soc2009/trasz_limits/sys/compat/linux/linux_misc.c#17 (text+ko) ====

@@ -376,7 +376,7 @@
 	}
 	error = rusage_set(td->td_proc, RUSAGE_DATA,
 	    a_out->a_data + bss_size);
-	if (error) {
+	if (error != 0) {
 		error = ENOMEM;
 		goto cleanup;
 	}

==== //depot/projects/soc2009/trasz_limits/sys/compat/svr4/imgact_svr4.c#10 (text+ko) ====

@@ -121,7 +121,7 @@
         return (ENOMEM);
     error = rusage_set(imgp->proc, RUSAGE_DATA,
         a_out->a_data + bss_size);
-    if (error)
+    if (error != 0)
         return (ENOMEM);
 #endif
 

==== //depot/projects/soc2009/trasz_limits/sys/i386/linux/imgact_linux.c#9 (text+ko) ====

@@ -119,7 +119,7 @@
 	return (ENOMEM);
     error = rusage_set(imgp->proc, RUSAGE_DATA,
 	a_out->a_data + bss_size);
-    if (error)
+    if (error != 0)
 	return (ENOMEM);
 #endif /* CONTAINERS */
 

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

@@ -203,7 +203,7 @@
 		return (ENOMEM);
 	error = rusage_set(imgp->proc, RUSAGE_DATA,
 	    a_out->a_data + bss_size);
-	if (error)
+	if (error != 0)
 		return (ENOMEM);
 #endif /* CONTAINERS */
 

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

@@ -890,11 +890,11 @@
 		return (ENOMEM);
 	error = rusage_set(imgp->proc, RUSAGE_DATA,
 	    data_size);
-	if (error)
+	if (error != 0)
 		return (ENOMEM);
 	error = rusage_set(imgp->proc, RUSAGE_VMEM,
 	    total_size);
-	if (error)
+	if (error != 0)
 		return (ENOMEM);
 #endif /* CONTAINERS */
 

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

@@ -232,7 +232,7 @@
 	}
 	error = rusage_set(gz->ip->proc, RUSAGE_DATA,
 	    gz->a_out.a_data + gz->bss_size);
-	if (error)
+	if (error != 0)
 		return (ENOMEM);
 #endif /* CONTAINERS */
 	/* Find out how far we should go */

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

@@ -165,7 +165,7 @@
 		if (dest->c_parents[i] == NULL)
 			continue;
 		error = container_add(dest->c_parents[i], src);
-		if (error) {
+		if (error != 0) {
 			for (i--; i >= 0; i--)
 				container_sub(dest->c_parents[i], src);
 			return (error);
@@ -242,7 +242,7 @@
 		    ("container already joined"));
 		if (child->c_parents[i] == NULL) {
 			error = container_add(parent, child);
-			if (error) {
+			if (error != 0) {
 				SDT_PROBE(container, kernel, container, join_failure, child, parent, 0, 0, 0);
 				return (error);
 			}
@@ -638,7 +638,7 @@
 			continue;
 
 		error = rusage_set_locked(child, i, parent->p_container.c_resources[i]);
-		if (error) {
+		if (error != 0) {
 			/*
 			 * XXX: The only purpose of these two lines is to prevent from
 			 * tripping checks in container_destroy().
@@ -658,7 +658,7 @@
 		if (container == NULL)
 			continue;
 		error = container_join_locked(&child->p_container, container);
-		if (error) {
+		if (error != 0) {
 			/*
 			 * XXX: The only purpose of these two lines is to prevent from
 			 * tripping checks in container_destroy().
@@ -678,7 +678,7 @@
 #ifdef HRL
 	if (error == 0) {
 		error = hrl_proc_fork(parent, child);
-		if (error) {
+		if (error != 0) {
 			mtx_lock(&container_lock);
 			container_destroy(&child->p_container);
 			mtx_unlock(&container_lock);

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

@@ -226,7 +226,7 @@
 
 #ifdef CONTAINERS
 	error = rusage_add(p1, RUSAGE_NPROC, 1);
-	if (error)
+	if (error != 0)
 		return (error);
 #endif
 
@@ -277,7 +277,7 @@
 		}
 		*procp = NULL;
 #ifdef CONTAINERS
-		if (error)
+		if (error != 0)
 			rusage_sub(p1, RUSAGE_NPROC, 1);
 #endif
 		return (error);
@@ -361,7 +361,7 @@
 	 * Initialize resource container for the child process.
 	 */
 	error = container_proc_fork(p1, newproc);
-	if (error) {
+	if (error != 0) {
 		error = EAGAIN;
 		goto fail;
 	}
@@ -369,7 +369,7 @@
 	 * After fork, there is exactly one thread running.
 	 */
 	error = rusage_set(newproc, RUSAGE_NTHR, 1);
-	if (error) {
+	if (error != 0) {
 		error = EAGAIN;
 		goto fail;
 	}

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

@@ -727,7 +727,7 @@
 		rule->hr_subject_type = HRL_SUBJECT_TYPE_UNDEFINED;
 	else {
 		error = str2value(subjectstr, &rule->hr_subject_type, subjectnames);
-		if (error)
+		if (error != 0)
 			goto out;
 	}
 
@@ -743,7 +743,7 @@
 		 */
 		if (rule->hr_subject_type != HRL_SUBJECT_TYPE_LOGINCLASS) {
 			error = str2id(subject_idstr, &id);
-			if (error)
+			if (error != 0)
 				goto out;
 		}
 		switch (rule->hr_subject_type) {
@@ -785,7 +785,7 @@
 	else {
 		error = str2value(resourcestr, &rule->hr_resource,
 		    resourcenames);
-		if (error)
+		if (error != 0)
 			goto out;
 	}
 
@@ -793,7 +793,7 @@
 		rule->hr_action = HRL_ACTION_UNDEFINED;
 	else {
 		error = str2value(actionstr, &rule->hr_action, actionnames);
-		if (error)
+		if (error != 0)
 			goto out;
 	}
 
@@ -801,7 +801,7 @@
 		rule->hr_amount = HRL_AMOUNT_UNDEFINED;
 	else {
 		error = str2int64(amountstr, &rule->hr_amount);
-		if (error)
+		if (error != 0)
 			goto out;
 	}
 
@@ -809,12 +809,12 @@
 		rule->hr_per = HRL_SUBJECT_TYPE_UNDEFINED;
 	else {
 		error = str2value(perstr, &rule->hr_per, subjectnames);
-		if (error)
+		if (error != 0)
 			goto out;
 	}
 
 out:
-	if (error) {
+	if (error != 0) {
 		hrl_rule_release(rule);
 		return (NULL);
 	}
@@ -1021,7 +1021,7 @@
 
 	str = malloc(inbuflen + 1, M_HRL, M_WAITOK);
 	error = copyinstr(inbufp, str, inbuflen, NULL);
-	if (error) {
+	if (error != 0) {
 		free(str, M_HRL);
 		return (error);
 	}
@@ -1081,7 +1081,7 @@
 	struct prison *pr;
 
 	error = hrl_read_inbuf(&inputstr, uap->inbufp, uap->inbuflen);
-	if (error)
+	if (error != 0)
 		return (error);
 
 	sx_slock(&allproc_lock);
@@ -1131,7 +1131,7 @@
 out:
 	hrl_rule_release(filter);
 	sx_sunlock(&allproc_lock);
-	if (error)
+	if (error != 0)
 		return (error);
 
 	error = hrl_write_outbuf(outputsbuf, uap->outbufp, uap->outbuflen);
@@ -1170,7 +1170,7 @@
 	struct proc *p;
 
 	error = hrl_read_inbuf(&inputstr, uap->inbufp, uap->inbuflen);
-	if (error)
+	if (error != 0)
 		return (error);
 
 	sx_slock(&allproc_lock);
@@ -1240,7 +1240,7 @@
 	struct hrl_rule_link *link;
 
 	error = hrl_read_inbuf(&inputstr, uap->inbufp, uap->inbuflen);
-	if (error)
+	if (error != 0)
 		return (error);
 
 	sx_slock(&allproc_lock);
@@ -1306,11 +1306,11 @@
 	char *inputstr;
 
 	error = priv_check(td, PRIV_HRL_SET);
-	if (error)
+	if (error != 0)
 		return (error);
 
 	error = hrl_read_inbuf(&inputstr, uap->inbufp, uap->inbuflen);
-	if (error)
+	if (error != 0)
 		return (error);
 
 	sx_slock(&allproc_lock);
@@ -1357,11 +1357,11 @@
 	char *inputstr;
 
 	error = priv_check(td, PRIV_HRL_SET);
-	if (error)
+	if (error != 0)
 		return (error);
 
 	error = hrl_read_inbuf(&inputstr, uap->inbufp, uap->inbuflen);
-	if (error)
+	if (error != 0)
 		return (error);
 
 	sx_slock(&allproc_lock);
@@ -1524,11 +1524,11 @@
 			rule->hr_subject.hs_proc = child;
 			error = hrl_container_add_rule_locked(&child->p_container, rule);
 			hrl_rule_release(rule);
-			if (error)
+			if (error != 0)
 				goto fail;
 		} else {
 			error = hrl_container_add_rule_locked(&child->p_container, link->hrl_rule);
-			if (error)
+			if (error != 0)
 				goto fail;
 		}
 	}

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

@@ -189,7 +189,7 @@
 	struct ucred *newcred, *oldcred;
 
 	error = priv_check(td, PRIV_PROC_SETLOGINCLASS);
-	if (error)
+	if (error != 0)
 		return (error);
 	error = copyinstr(uap->namebuf, lcname, sizeof(lcname), NULL);
 	if (error == ENAMETOOLONG)
@@ -221,7 +221,7 @@
 
 	LIST_FOREACH_SAFE(lc, &loginclasses, lc_next, lctmp) {
 		error = (callback)(&lc->lc_container, filter, arg3);
-		if (error)
+		if (error != 0)
 			return (error);
 	}
 

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

@@ -1434,7 +1434,7 @@
 		for (uip = LIST_FIRST(uih); uip; uip = nextuip) {
 			nextuip = LIST_NEXT(uip, ui_hash);
 			error = (callback)(&uip->ui_container, filter, arg3);
-			if (error) {
+			if (error != 0) {
 				rw_runlock(&uihashtbl_lock);
 				return (error);
 			}

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

@@ -993,7 +993,7 @@
 	td->td_retval[0] = 0;
 done3:
 #ifdef CONTAINERS
-	if (error) {
+	if (error != 0) {
 		rusage_sub(td->td_proc, RUSAGE_MSGQQUEUED, 1);
 		rusage_sub(td->td_proc, RUSAGE_MSGQSIZE, saved_msgsz);
 	}

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

@@ -315,7 +315,7 @@
 #ifdef CONTAINER
 	if (td != NULL) {
 		error = rusage_add(td->td_proc, RUSAGE_SBSIZE, cc);
-		if (error)
+		if (error != 0)
 			return (0);
 	} else
 		rusage_add_cred(so->so_cred, RUSAGE_SBSIZE, cc);

==== //depot/projects/soc2009/trasz_limits/sys/vm/vm_unix.c#10 (text+ko) ====

@@ -108,7 +108,7 @@
 #ifdef CONTAINERS
 		error = rusage_set(td->td_proc, RUSAGE_DATA,
 		    new - base);
-		if (error) {
+		if (error != 0) {
 			error = ENOMEM;
 			goto done;
 		}
@@ -137,7 +137,7 @@
 #ifdef CONTAINERS
 		error = rusage_set(td->td_proc, RUSAGE_VMEM,
 		    vm->vm_map.size + (new - old));
-		if (error) {
+		if (error != 0) {
 			error = ENOMEM;
 			goto done;
 		}

==== //depot/projects/soc2009/trasz_limits/usr.bin/id/id.c#6 (text+ko) ====

@@ -169,7 +169,7 @@
 
 	if (cflag) {
 		error = getloginclass(loginclass, sizeof(loginclass));
-		if (error)
+		if (error != 0)
 			err(1, "loginclass");
 		(void)printf("%s\n", loginclass);
 		exit(0);

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

@@ -296,7 +296,7 @@
 	int error;
 
 	error = hrl_add_rule(rule, strlen(rule) + 1, NULL, 0);
-	if (error)
+	if (error != 0)
 		err(1, "hrl_add_rule");
 	free(rule);
 }
@@ -330,7 +330,7 @@
 	int error;
 
 	error = hrl_remove_rule(filter, strlen(filter) + 1, NULL, 0);
-	if (error)
+	if (error != 0)
 		err(1, "hrl_remove_rule");
 	free(filter);
 }


More information about the p4-projects mailing list