PERFORCE change 92284 for review
Todd Miller
millert at FreeBSD.org
Thu Feb 23 11:19:19 PST 2006
http://perforce.freebsd.org/chv.cgi?CH=92284
Change 92284 by millert at millert_g4tower on 2006/02/23 19:19:13
Convert some if() else to switch().
Affected files ...
.. //depot/projects/trustedbsd/sedarwin7/src/darwin/xnu/osfmk/kern/security.c#4 edit
Differences ...
==== //depot/projects/trustedbsd/sedarwin7/src/darwin/xnu/osfmk/kern/security.c#4 (text+ko) ====
@@ -87,12 +87,16 @@
rc = mac_check_service_access(&subjl, &objl, serv, perm);
mac_destroy_task_label(&subjl);
mac_destroy_task_label(&objl);
- if (rc == /*EINVAL*/ 22)
+
+ switch (rc) {
+ case 0:
+ return KERN_SUCCESS;
+ case 22:
+ /* EINVAL */
return KERN_INVALID_ARGUMENT;
- else if (rc != 0)
+ default:
return KERN_NO_ACCESS;
- else
- return 0;
+ }
}
kern_return_t
@@ -143,12 +147,15 @@
io_unlock (objp);
mac_destroy_task_label(&subjl);
- if (rc == /*EINVAL*/ 22)
+ switch (rc) {
+ case 0:
+ return KERN_SUCCESS;
+ case 22:
+ /* EINVAL */
return KERN_INVALID_ARGUMENT;
- else if (rc != 0)
+ default:
return KERN_NO_ACCESS;
- else
- return 0;
+ }
}
kern_return_t
@@ -197,12 +204,15 @@
io_unlock(objp);
ipc_port_multiple_unlock();
- if (rc == /*EINVAL*/ 22)
+ switch (rc) {
+ case 0:
+ return KERN_SUCCESS;
+ case 22:
+ /* EINVAL */
return KERN_INVALID_ARGUMENT;
- else if (rc != 0)
+ default:
return KERN_NO_ACCESS;
- else
- return 0;
+ }
errout:
io_unlocklabel(subp);
More information about the trustedbsd-cvs
mailing list