git: 15bf81f354a4 - main - struct image_params: use bool type for boolean members

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Thu, 28 Oct 2021 17:50:38 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=15bf81f354a428723d7e9ea61ea215d4195aa050

commit 15bf81f354a428723d7e9ea61ea215d4195aa050
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-10-23 15:05:56 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-10-28 17:49:21 +0000

    struct image_params: use bool type for boolean members
    
    Also re-align comments, and group booleans and char members together.
    
    Reviewed by:    markj
    Tested by:      pho
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D32611
---
 sys/kern/kern_exec.c |  6 +++---
 sys/sys/imgact.h     | 26 +++++++++++++-------------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index e86d19e9eed1..5cc5a1205901 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -687,7 +687,7 @@ interpret:
 #endif
 		if (imgp->opened) {
 			VOP_CLOSE(newtextvp, FREAD, td->td_ucred, td);
-			imgp->opened = 0;
+			imgp->opened = false;
 		}
 		vput(newtextvp);
 		vm_object_deallocate(imgp->object);
@@ -1091,7 +1091,7 @@ exec_new_vmspace(struct image_params *imgp, struct sysentvec *sv)
 	vm_prot_t stack_prot;
 	u_long ssiz;
 
-	imgp->vmspace_destroyed = 1;
+	imgp->vmspace_destroyed = true;
 	imgp->sysent = sv;
 
 	if (p->p_sysent->sv_onexec_old != NULL)
@@ -1791,7 +1791,7 @@ exec_check_permissions(struct image_params *imgp)
 	 */
 	error = VOP_OPEN(vp, FREAD, td->td_ucred, td, NULL);
 	if (error == 0)
-		imgp->opened = 1;
+		imgp->opened = true;
 	return (error);
 }
 
diff --git a/sys/sys/imgact.h b/sys/sys/imgact.h
index ef4de48c3e6d..0e99737a84a7 100644
--- a/sys/sys/imgact.h
+++ b/sys/sys/imgact.h
@@ -58,21 +58,16 @@ struct image_args {
 };
 
 struct image_params {
-	struct proc *proc;	/* our process struct */
+	struct proc *proc;		/* our process */
 	struct label *execlabel;	/* optional exec label */
-	struct vnode *vp;	/* pointer to vnode of file to exec */
+	struct vnode *vp;		/* pointer to vnode of file to exec */
 	struct vm_object *object;	/* The vm object for this vp */
-	struct vattr *attr;	/* attributes of file */
-	const char *image_header; /* head of file to exec */
-	unsigned long entry_addr; /* entry address of target executable */
-	unsigned long reloc_base; /* load address of image */
-	char vmspace_destroyed;	/* flag - we've blown away original vm space */
-#define IMGACT_SHELL	0x1
-#define IMGACT_BINMISC	0x2
-	unsigned char interpreted;	/* mask of interpreters that have run */
-	char opened;		/* flag - we have opened executable vnode */
-	char *interpreter_name;	/* name of the interpreter */
-	void *auxargs;		/* ELF Auxinfo structure pointer */
+	struct vattr *attr;		/* attributes of file */
+	const char *image_header;	/* header of file to exec */
+	unsigned long entry_addr;	/* entry address of target executable */
+	unsigned long reloc_base;	/* load address of image */
+	char *interpreter_name;		/* name of the interpreter */
+	void *auxargs;			/* ELF Auxinfo structure pointer */
 	struct sf_buf *firstpage;	/* first page that we mapped */
 	void *ps_strings;		/* pointer to ps_string (user space) */
 	struct image_args *args;	/* system call arguments */
@@ -90,7 +85,12 @@ struct image_params {
 	u_long stack_sz;
 	u_long eff_stack_sz;
 	struct ucred *newcred;		/* new credentials if changing */
+#define IMGACT_SHELL	0x1
+#define IMGACT_BINMISC	0x2
+	unsigned char interpreted;	/* mask of interpreters that have run */
 	bool credential_setid;		/* true if becoming setid */
+	bool vmspace_destroyed;		/* we've blown away original vm space */
+	bool opened;			/* we have opened executable vnode */
 	bool textset;
 	u_int map_flags;
 };