]> git.saurik.com Git - apple/xnu.git/blobdiff - tests/mach_port_deallocate_21692215.c
xnu-4903.270.47.tar.gz
[apple/xnu.git] / tests / mach_port_deallocate_21692215.c
index 4b84428f60acde8d5e7139cf6cd5cd001ba319f7..0b15106002f47d5dfa8cad8eaf4bc6131d95cfaf 100644 (file)
@@ -9,16 +9,16 @@
 T_DECL(mach_port_deallocate, "mach_port_deallocate deallocates also PORT_SET"){
        mach_port_t port_set;
        mach_port_t port[NR_PORTS];
-       int i,ret;
+       int i, ret;
 
-       ret= mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_PORT_SET, &port_set);
+       ret = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_PORT_SET, &port_set);
        T_ASSERT_MACH_SUCCESS(ret, "mach_port_allocate MACH_PORT_RIGHT_PORT_SET");
 
-       for(i=0;i<NR_PORTS;i++){
-               ret= mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &port[i]);
+       for (i = 0; i < NR_PORTS; i++) {
+               ret = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &port[i]);
                T_ASSERT_MACH_SUCCESS(ret, "mach_port_allocate MACH_PORT_RIGHT_RECEIVE");
 
-               ret= mach_port_move_member(mach_task_self(), port[i], port_set);
+               ret = mach_port_move_member(mach_task_self(), port[i], port_set);
                T_ASSERT_MACH_SUCCESS(ret, "mach_port_move_member");
        }
 
@@ -26,12 +26,12 @@ T_DECL(mach_port_deallocate, "mach_port_deallocate deallocates also PORT_SET"){
 
        /* do something */
 
-       for(i=0;i<NR_PORTS;i++){
-               ret= mach_port_mod_refs(mach_task_self(), port[i], MACH_PORT_RIGHT_RECEIVE, -1);
+       for (i = 0; i < NR_PORTS; i++) {
+               ret = mach_port_mod_refs(mach_task_self(), port[i], MACH_PORT_RIGHT_RECEIVE, -1);
                T_ASSERT_MACH_SUCCESS(ret, "mach_port_mod_refs -1 RIGHT_RECEIVE");
        }
 
-       ret= mach_port_deallocate(mach_task_self(), port_set);
+       ret = mach_port_deallocate(mach_task_self(), port_set);
        T_ASSERT_MACH_SUCCESS(ret, "mach_port_deallocate PORT_SET");
 
        T_LOG("Ports erased");