Date: Thu, 6 Nov 2003 20:51:53 -0800 (PST) From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 41619 for review Message-ID: <200311070451.hA74pr5m002647@repoman.freebsd.org>
index | next in thread | raw e-mail
http://perforce.freebsd.org/chv.cgi?CH=41619 Change 41619 by rwatson@rwatson_paprika on 2003/11/06 20:51:18 Trim trailing whitespace. Linewrap. Affected files ... .. //depot/projects/trustedbsd/mac/sys/kern/sysv_ipc.c#9 edit .. //depot/projects/trustedbsd/mac/sys/kern/sysv_msg.c#16 edit .. //depot/projects/trustedbsd/mac/sys/kern/sysv_sem.c#17 edit .. //depot/projects/trustedbsd/mac/sys/kern/sysv_shm.c#16 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/kern/sysv_ipc.c#9 (text+ko) ==== @@ -72,9 +72,9 @@ /* - * Note: The MAC Framework doesnt add any hook to the ipcperm function as + * Note: The MAC Framework doesnt add any hook to the ipcperm function as * fine-grained hooks are inserted throughout the ipc primitives. These hooks - * compliment the ipcperm check. + * compliment the ipcperm check. */ int ==== //depot/projects/trustedbsd/mac/sys/kern/sysv_msg.c#16 (text+ko) ==== @@ -56,7 +56,7 @@ #ifdef MAC_DEBUG #define MPRINTF(a) printf(a) #else -#define MPRINTF(a) +#define MPRINTF(a) #endif static void msg_freehdr(struct msg *msghdr); @@ -230,7 +230,7 @@ } mtx_init(&msq_mtx, "msq", NULL, MTX_DEF); refcount = 0; - /* + /* * It is not permissible to pass the same mutex to mtx_init() * multiple times without intervening calls to mtx_destroy(). Since * we cannot destroy the refcnt_mtx during msgunload, we check if the @@ -247,7 +247,7 @@ struct msqid_kernel *msqkptr; int msqid; - /* + /* * Make sure that the msgunload maintains the consistency of the * msqids and msghdrs data structures. This assures that the unload * doesn't take place if any thread is in any of the code-paths @@ -282,18 +282,18 @@ #ifdef MAC int i; /* Clean up the MAC label associated with the msg objects. */ - for (i = 0; i < msginfo.msgtql; i++) + for (i = 0; i < msginfo.msgtql; i++) mac_destroy_ipc_msgmsg(&msghdrs[i]); /* Clean up the MAC label associated with the msq objects. */ - for (msqid = 0; msqid < msginfo.msgmni; msqid++) + for (msqid = 0; msqid < msginfo.msgmni; msqid++) mac_destroy_ipc_msgqueue(&msqids[msqid]); -#endif +#endif free(msgpool, M_MSG); free(msgmaps, M_MSG); free(msghdrs, M_MSG); free(msqids, M_MSG); mtx_destroy(&msq_mtx); - /* + /* * NOTE: We cannot destroy the refcnt_mtx as it is possible that * some thread might (attempt to) hold the mutex. */ @@ -444,7 +444,7 @@ goto done3; } if (cmd == IPC_SET && - (error = copyin(user_msqptr, &msqbuf, sizeof(msqbuf))) != 0) + (error = copyin(user_msqptr, &msqbuf, sizeof(msqbuf))) != 0) goto done3; msqkptr = &msqids[msqid]; @@ -481,7 +481,7 @@ goto done2; #ifdef MAC - /* + /* * Check that the thread has MAC access permissions to * individual msghdrs. Note: We need to do this in a * separate loop because the actual loop alters the @@ -782,7 +782,7 @@ goto done2; } -#ifdef MAC +#ifdef MAC /* * Make sure that the thread has access rights to the message * queue. @@ -909,7 +909,7 @@ msghdr->msg_ts = msgsz; #ifdef MAC mac_create_ipc_msgmsg(td->td_ucred, msqkptr, msghdr); - /* + /* * XXX: Should the mac_check_ipc_msgmsq check follow here * immediately? Or, should it be checked just before the msg is * enqueued in the msgq (as it is done now)? @@ -1142,7 +1142,7 @@ goto done2; } -#ifdef MAC +#ifdef MAC /* * Make sure that the thread has access rights to the message queue. */ @@ -1171,14 +1171,14 @@ * Make sure that the thread has access * rights to the message header. */ - if ((error = mac_check_ipc_msgrcv(td->td_ucred, + if ((error = mac_check_ipc_msgrcv(td->td_ucred, msghdr))) { MPRINTF(( "MAC Framework: mac_check_ipc_msgrcv permission denied\n")); goto done2; } #endif - if (msqkptr->u.msg_first == msqkptr->u.msg_last) { + if (msqkptr->u.msg_first == msqkptr->u.msg_last) { msqkptr->u.msg_first = NULL; msqkptr->u.msg_last = NULL; } else { ==== //depot/projects/trustedbsd/mac/sys/kern/sysv_sem.c#17 (text+ko) ==== @@ -61,7 +61,7 @@ #endif static struct sem_undo *semu_alloc(struct thread *td); -static int semundo_adjust(struct thread *td, struct sem_undo **supptr, +static int semundo_adjust(struct thread *td, struct sem_undo **supptr, int semid, int semnum, int adjval); static void semundo_clear(int semid, int semnum); @@ -223,14 +223,14 @@ SLIST_INIT(&semu_list); mtx_init(&sem_mtx, "sem", NULL, MTX_DEF); refcount =0; - /* - * It is not permissible to pass the same mutex to mtx_init() multiple - * times without intervening calls to mtx_destroy(). - * Since we cannot destroy the refcnt_mtx during semunload, we check if - * the mtx_init has ever been called. If so, we dont need to do mtx_init - * as the mutex is already initialized. + /* + * It is not permissible to pass the same mutex to mtx_init() + * multiple times without intervening calls to mtx_destroy(). + * Since we cannot destroy the refcnt_mtx during semunload, we check + * if the mtx_init has ever been called. If so, we dont need to do + * mtx_init as the mutex is already initialized. */ - if ( mtx_initialized(&refcnt_mtx) == 0 ) + if (mtx_initialized(&refcnt_mtx) == 0) mtx_init(&refcnt_mtx, "semrefcnt", NULL, MTX_DEF); semexit_tag = EVENTHANDLER_REGISTER(process_exit, semexit_myhook, NULL, EVENTHANDLER_PRI_ANY); @@ -241,12 +241,12 @@ { int i; - /* - * Make sure that the semunload maintains the consistency of the sem + /* + * Make sure that the semunload maintains the consistency of the sem * and sema data structures. This assures that the unload doesn't take * place if any thread is in any of the code-paths (tinkering with the - * data structures), and also that no thread can enter the code-paths - * once the module is unloaded. + * data structures), and also that no thread can enter the code-paths + * once the module is unloaded. */ mtx_lock(&refcnt_mtx); if ((refcount > 0) || (semtot != 0)) { @@ -260,15 +260,15 @@ #ifdef MAC for (i = 0; i < seminfo.semmni; i++) mac_destroy_ipc_sema(&sema[i]); -#endif +#endif free(sem, M_SEM); free(sema, M_SEM); free(semu, M_SEM); for (i = 0; i < seminfo.semmni; i++) mtx_destroy(&sema_mtx[i]); mtx_destroy(&sem_mtx); - /* - * NOTE: We cannot destroy the refcnt_mtx as it is possible that some + /* + * NOTE: We cannot destroy the refcnt_mtx as it is possible that some * thread might (attempt to) hold the mutex. */ /* mtx_destroy(&refcnt_mtx); */ @@ -619,7 +619,7 @@ sema_mtxp = &sema_mtx[semid]; #ifdef MAC mtx_lock(sema_mtxp); - /* + /* * The MAC framework lets the policies decide what type of access * is permitted, based on the cmd. */ @@ -903,7 +903,7 @@ error = EEXIST; goto done2; } -#ifdef MAC +#ifdef MAC if ((error = mac_check_ipc_semget(cred, &sema[semid]))) { MPRINTF(( @@ -1077,7 +1077,7 @@ goto done2; } #ifdef MAC - /* + /* * The MAC hook checks whether the thread has read (and possibly * write) permissions to the semaphore array based on the * sopptr->sem_op value. ==== //depot/projects/trustedbsd/mac/sys/kern/sysv_shm.c#16 (text+ko) ==== @@ -461,7 +461,7 @@ return (error); } -int +int shmat(td, uap) struct thread *td; struct shmat_args *uap; @@ -1056,12 +1056,12 @@ shmunload() { - /* + /* * Make sure that the shmunload maintains the consistency of the * shmsegs data structure. This assures that the unload doesn't * take place if any thread is in any of the code-paths (tinkering * with the data structures), and also that no thread can enter - * the code-paths once the module is unloaded. + * the code-paths once the module is unloaded. */ mtx_lock(&refcnt_mtx); if ((refcount > 0) || (shm_nused > 0)) { @@ -1073,7 +1073,7 @@ #ifdef MAC int i; - for (i = 0; i < shmalloced; i++) + for (i = 0; i < shmalloced; i++) mac_destroy_ipc_shm(&shmsegs[i]); #endif free(shmsegs, M_SHM);home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311070451.hA74pr5m002647>
