Date: Thu, 23 Feb 2006 19:19:14 GMT From: Todd Miller <millert@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 92284 for review Message-ID: <200602231919.k1NJJE7J015023@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=92284 Change 92284 by millert@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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602231919.k1NJJE7J015023>