git: 184936164435 - stable/13 - struct image_params: use bool type for boolean members
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 06 Nov 2021 02:25:17 UTC
The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=18493616443539ccef910e7af0c8f65c9208ba9f commit 18493616443539ccef910e7af0c8f65c9208ba9f Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-10-23 15:05:56 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-11-06 02:12:31 +0000 struct image_params: use bool type for boolean members (cherry picked from commit 15bf81f354a428723d7e9ea61ea215d4195aa050) --- 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 1fd11e34a048..9b8ee7025a94 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -654,7 +654,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); @@ -1092,7 +1092,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) @@ -1855,7 +1855,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 cd130551c050..9e884ef08d96 100644 --- a/sys/sys/imgact.h +++ b/sys/sys/imgact.h @@ -59,21 +59,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 */ @@ -91,7 +86,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; };