linux*_sysvec.c: rationalize whitespace and comments

There's a fair amount of duplication between MD linuxulator files.
Make indentation and comments consistent between the three versions of
linux_sysvec.c to reduce diffs when comparing them.

Sponsored by:	Turing Robotic Industries Inc.
This commit is contained in:
Ed Maste 2018-03-19 15:11:10 +00:00
parent c69defc269
commit 9bec2ea66e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=331208
3 changed files with 40 additions and 43 deletions

View File

@ -126,6 +126,7 @@ static void linux_vdso_install(void *param);
static void linux_vdso_deinstall(void *param);
static void linux_set_syscall_retval(struct thread *td, int error);
static int linux_fetch_syscall_args(struct thread *td);
static int exec_linux_imgact_try(struct image_params *iparams);
static void linux_exec_setregs(struct thread *td, struct image_params *imgp,
u_long stack);
static int linux_vsyscall(struct thread *td);
@ -669,8 +670,6 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
* be able to modify the interpreter path. We only do this if a Linux
* binary is doing the exec, so we do not create an EXEC module for it.
*/
static int exec_linux_imgact_try(struct image_params *iparams);
static int
exec_linux_imgact_try(struct image_params *imgp)
{
@ -685,15 +684,14 @@ exec_linux_imgact_try(struct image_params *imgp)
*/
if (((const short *)head)[0] == SHELLMAGIC) {
/*
* Run our normal shell image activator. If it succeeds
* attempt to use the alternate path for the interpreter.
* If an alternate path is found, use our stringspace
* to store it.
* Run our normal shell image activator. If it succeeds then
* attempt to use the alternate path for the interpreter. If
* an alternate path is found, use our stringspace to store it.
*/
if ((error = exec_shell_imgact(imgp)) == 0) {
linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc),
imgp->interpreter_name, UIO_SYSSPACE,
&rpath, 0, AT_FDCWD);
imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0,
AT_FDCWD);
if (rpath != NULL)
imgp->args->fname_buf =
imgp->interpreter_name = rpath;

View File

@ -124,6 +124,7 @@ static int elf_linux_fixup(register_t **stack_base,
struct image_params *iparams);
static register_t *linux_copyout_strings(struct image_params *imgp);
static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask);
static int exec_linux_imgact_try(struct image_params *iparams);
static void exec_linux_setregs(struct thread *td,
struct image_params *imgp, u_long stack);
static void linux32_fixlimit(struct rlimit *rl, int which);
@ -722,8 +723,6 @@ linux32_fetch_syscall_args(struct thread *td)
* be able to modify the interpreter path. We only do this if a Linux
* binary is doing the exec, so we do not create an EXEC module for it.
*/
static int exec_linux_imgact_try(struct image_params *iparams);
static int
exec_linux_imgact_try(struct image_params *imgp)
{
@ -732,16 +731,16 @@ exec_linux_imgact_try(struct image_params *imgp)
int error = -1;
/*
* The interpreter for shell scripts run from a Linux binary needs
* to be located in /compat/linux if possible in order to recursively
* maintain Linux path emulation.
*/
* The interpreter for shell scripts run from a Linux binary needs
* to be located in /compat/linux if possible in order to recursively
* maintain Linux path emulation.
*/
if (((const short *)head)[0] == SHELLMAGIC) {
/*
* Run our normal shell image activator. If it succeeds attempt
* to use the alternate path for the interpreter. If an
* alternate * path is found, use our stringspace to store it.
*/
* Run our normal shell image activator. If it succeeds then
* attempt to use the alternate path for the interpreter. If
* an alternate path is found, use our stringspace to store it.
*/
if ((error = exec_shell_imgact(imgp)) == 0) {
linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc),
imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0,

View File

@ -112,6 +112,7 @@ static int linux_fixup(register_t **stack_base,
static int elf_linux_fixup(register_t **stack_base,
struct image_params *iparams);
static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask);
static int exec_linux_imgact_try(struct image_params *iparams);
static void exec_linux_setregs(struct thread *td,
struct image_params *imgp, u_long stack);
static register_t *linux_copyout_strings(struct image_params *imgp);
@ -819,35 +820,34 @@ linux_fetch_syscall_args(struct thread *td)
* be able to modify the interpreter path. We only do this if a Linux
* binary is doing the exec, so we do not create an EXEC module for it.
*/
static int exec_linux_imgact_try(struct image_params *iparams);
static int
exec_linux_imgact_try(struct image_params *imgp)
{
const char *head = (const char *)imgp->image_header;
char *rpath;
int error = -1;
const char *head = (const char *)imgp->image_header;
char *rpath;
int error = -1;
/*
* The interpreter for shell scripts run from a Linux binary needs
* to be located in /compat/linux if possible in order to recursively
* maintain Linux path emulation.
*/
if (((const short *)head)[0] == SHELLMAGIC) {
/*
* Run our normal shell image activator. If it succeeds attempt
* to use the alternate path for the interpreter. If an alternate
* path is found, use our stringspace to store it.
*/
if ((error = exec_shell_imgact(imgp)) == 0) {
linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc),
imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0, AT_FDCWD);
if (rpath != NULL)
imgp->args->fname_buf =
imgp->interpreter_name = rpath;
}
}
return (error);
/*
* The interpreter for shell scripts run from a Linux binary needs
* to be located in /compat/linux if possible in order to recursively
* maintain Linux path emulation.
*/
if (((const short *)head)[0] == SHELLMAGIC) {
/*
* Run our normal shell image activator. If it succeeds then
* attempt to use the alternate path for the interpreter. If
* an alternate path is found, use our stringspace to store it.
*/
if ((error = exec_shell_imgact(imgp)) == 0) {
linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc),
imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0,
AT_FDCWD);
if (rpath != NULL)
imgp->args->fname_buf =
imgp->interpreter_name = rpath;
}
}
return (error);
}
/*