Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Mar 2018 15:11:10 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r331208 - in head/sys: amd64/linux amd64/linux32 i386/linux
Message-ID:  <201803191511.w2JFBAZM047729@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Mon Mar 19 15:11:10 2018
New Revision: 331208
URL: https://svnweb.freebsd.org/changeset/base/331208

Log:
  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.

Modified:
  head/sys/amd64/linux/linux_sysvec.c
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/i386/linux/linux_sysvec.c

Modified: head/sys/amd64/linux/linux_sysvec.c
==============================================================================
--- head/sys/amd64/linux/linux_sysvec.c	Mon Mar 19 15:07:15 2018	(r331207)
+++ head/sys/amd64/linux/linux_sysvec.c	Mon Mar 19 15:11:10 2018	(r331208)
@@ -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, 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)
 {
@@ -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;

Modified: head/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- head/sys/amd64/linux32/linux32_sysvec.c	Mon Mar 19 15:07:15 2018	(r331207)
+++ head/sys/amd64/linux32/linux32_sysvec.c	Mon Mar 19 15:11:10 2018	(r331208)
@@ -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: head/sys/i386/linux/linux_sysvec.c
==============================================================================
--- head/sys/i386/linux/linux_sysvec.c	Mon Mar 19 15:07:15 2018	(r331207)
+++ head/sys/i386/linux/linux_sysvec.c	Mon Mar 19 15:11:10 2018	(r331208)
@@ -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);
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803191511.w2JFBAZM047729>