From owner-svn-src-all@freebsd.org Sun Apr 28 13:35:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFC3F157E704; Sun, 28 Apr 2019 13:35:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9415A935BE; Sun, 28 Apr 2019 13:35:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EC90B4C5; Sun, 28 Apr 2019 13:35:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SDZb5W023258; Sun, 28 Apr 2019 13:35:37 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SDZaKq023255; Sun, 28 Apr 2019 13:35:36 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281335.x3SDZaKq023255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 13:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346824 - in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Commit-Revision: 346824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9415A935BE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:35:38 -0000 Author: dchagin Date: Sun Apr 28 13:35:36 2019 New Revision: 346824 URL: https://svnweb.freebsd.org/changeset/base/346824 Log: MFC r331208 (by emaste@): 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. Modified: stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/i386/linux/linux_sysvec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:33:35 2019 (r346823) +++ stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:35:36 2019 (r346824) @@ -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); @@ -668,8 +669,6 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse * 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) { @@ -684,15 +683,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; Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:33:35 2019 (r346823) +++ stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:35:36 2019 (r346824) @@ -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, Modified: stable/11/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:33:35 2019 (r346823) +++ stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:35:36 2019 (r346824) @@ -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); @@ -811,35 +812,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); } /*