X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/b226f5e54a60dc81db17b1260381d7dbfea3cdf1..0a7de7458d150b5d4dffc935ba399be265ef0a1a:/tests/xnu_quick_test_entitled.c diff --git a/tests/xnu_quick_test_entitled.c b/tests/xnu_quick_test_entitled.c index ec1252fb4..b3d6a9d4b 100644 --- a/tests/xnu_quick_test_entitled.c +++ b/tests/xnu_quick_test_entitled.c @@ -13,7 +13,7 @@ #include #endif -T_GLOBAL_META (T_META_NAMESPACE("xnu.quicktest"), T_META_CHECK_LEAKS(false)); +T_GLOBAL_META(T_META_NAMESPACE("xnu.quicktest"), T_META_CHECK_LEAKS(false)); /* ************************************************************************************************************** @@ -21,15 +21,15 @@ T_GLOBAL_META (T_META_NAMESPACE("xnu.quicktest"), T_META_CHECK_LEAKS(false)); * ************************************************************************************************************** */ T_DECL(ioctl, "Sanity check of ioctl by exercising DKIOCGETBLOCKCOUNT and DKIOCGETBLOCKSIZE", - T_META_ASROOT(true)) + T_META_ASROOT(true)) { - int my_err; - int my_fd = -1; - struct statfs * my_infop; - char * my_ptr; - int my_blksize; - long long my_block_count; - char my_name[ MAXPATHLEN ]; + int my_err; + int my_fd = -1; + struct statfs * my_infop; + char * my_ptr; + int my_blksize; + long long my_block_count; + char my_name[MAXPATHLEN]; #if !TARGET_OS_EMBEDDED /* @@ -37,7 +37,7 @@ T_DECL(ioctl, "Sanity check of ioctl by exercising DKIOCGETBLOCKCOUNT and DKIOCG * disabled or in AppleInternal mode */ if (csr_check( CSR_ALLOW_UNRESTRICTED_FS ) && - csr_check( CSR_ALLOW_APPLE_INTERNAL ) ) { + csr_check( CSR_ALLOW_APPLE_INTERNAL )) { T_SKIP("System Integrity Protection is enabled"); } #endif @@ -48,11 +48,11 @@ T_DECL(ioctl, "Sanity check of ioctl by exercising DKIOCGETBLOCKCOUNT and DKIOCG T_ASSERT_GT(getmntinfo( &my_infop, MNT_NOWAIT ), 0, "getmntinfo"); /* make this a raw device */ - strlcpy( &my_name[0], &my_infop->f_mntfromname[0], sizeof(my_name) ); - if ( (my_ptr = strrchr( &my_name[0], '/' )) != 0 ) { - if ( my_ptr[1] != 'r' ) { - my_ptr[ strlen( my_ptr ) ] = 0x00; - memmove( &my_ptr[2], &my_ptr[1], (strlen( &my_ptr[1] ) + 1) ); + strlcpy( &my_name[0], &my_infop->f_mntfromname[0], sizeof(my_name)); + if ((my_ptr = strrchr( &my_name[0], '/' )) != 0) { + if (my_ptr[1] != 'r') { + my_ptr[strlen( my_ptr )] = 0x00; + memmove( &my_ptr[2], &my_ptr[1], (strlen( &my_ptr[1] ) + 1)); my_ptr[1] = 'r'; } } @@ -63,11 +63,11 @@ T_DECL(ioctl, "Sanity check of ioctl by exercising DKIOCGETBLOCKCOUNT and DKIOCG /* obtain the size of the media (in blocks) */ T_EXPECT_POSIX_SUCCESS(my_err = ioctl( my_fd, DKIOCGETBLOCKCOUNT, &my_block_count ), - "ioctl DKIOCGETBLOCKCOUNT"); + "ioctl DKIOCGETBLOCKCOUNT"); /* obtain the block size of the media */ T_EXPECT_POSIX_SUCCESS(my_err = ioctl( my_fd, DKIOCGETBLOCKSIZE, &my_blksize ), - "ioctl DKIOCGETBLOCKSIZE"); + "ioctl DKIOCGETBLOCKSIZE"); T_LOG( "my_block_count %qd my_blksize %d \n", my_block_count, my_blksize );