On 5/7/23 12:26, Michael Tokarev wrote:
05.07.2023 12:00, Pierrick Bouvier wrote:
...


@@ -8696,11 +8697,14 @@ static int do_execveat(CPUArchState *cpu_env, int dirfd,
          goto execve_efault;
      }
+    const char* exe = p;
      if (is_proc_myself(p, "exe")) {
-        ret = get_errno(safe_execveat(dirfd, exec_path, argp, envp, flags));
-    } else {
-        ret = get_errno(safe_execveat(dirfd, p, argp, envp, flags));
+        exe = exec_path;
      }
+    ret = is_execveat ?
+        safe_execveat(dirfd, exe, argp, envp, flags):
+        safe_execve(exe, argp, envp);
+    ret = get_errno(ret);


ERROR: spaces required around that ':' (ctx:VxE)
#169: FILE: linux-user/syscall.c:8705:
+        safe_execveat(dirfd, exe, argp, envp, flags):
                                                      ^

total: 2 errors, 0 warnings, 47 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

As I mentioned in the v1, I don't remember offhand how the arithmetic if
should be styled in qemu.  At the very best, the v2 variant is difficult
to read because ":" is too close to ";" visually, an extra space before
it will make it more explicit.

KISS, alternatively:

    ret = is_execveat
          ? safe_execveat(dirfd, exe, argp, envp, flags)
          : safe_execve(exe, argp, envp);


Reply via email to