guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 03/04: remove 2nd attempt at invoking ComSpec when spawn


From: Mike Gran
Subject: [Guile-commits] 03/04: remove 2nd attempt at invoking ComSpec when spawning child
Date: Wed, 10 Mar 2021 10:30:54 -0500 (EST)

mike121 pushed a commit to branch master
in repository guile.

commit 1b697d339b3616f4a868585b4f9ccb754b5bea57
Author: Michael Gran <spk121@yahoo.com>
AuthorDate: Fri Jan 22 20:49:04 2021 -0800

    remove 2nd attempt at invoking ComSpec when spawning child
    
    The start_child procedure is used to spawn a child process. If it fails
    to launch the given argv[0] as if it were a command, it has logic to
    retry using the ComSpec as a command interpreter, treating argv[0] as
    a batch file name. Usually, this fails because batch files would have
    been handled in the first pass if they were valid.  Also, this has
    the unfortunate side effect of spawning a shell awaiting user input.
    
    It is safer to remove this attempt.
    
    * libguile/posix-w32.c (start_child): remove fallback processing
---
 libguile/posix-w32.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/libguile/posix-w32.c b/libguile/posix-w32.c
index e4a03eb..6302eec 100644
--- a/libguile/posix-w32.c
+++ b/libguile/posix-w32.c
@@ -1,4 +1,4 @@
-/* Copyright 2001,2006,2008,2016,2018
+/* Copyright 2001,2006,2008,2016,2018,2021
      Free Software Foundation, Inc.
 
    This file is part of Guile.
@@ -740,22 +740,6 @@ start_child (const char *exec_file, char **argv,
   CloseHandle (herr);
   CloseHandle (pi.hThread);
 
-  /* Posix requires to call the shell if execvp fails to invoke EXEC_FILE.  */
-  if (errno_save == ENOEXEC || errno_save == ENOENT)
-    {
-      const char *shell = getenv ("ComSpec");
-
-      if (!shell)
-        shell = "cmd.exe";
-
-      if (c_strcasecmp (exec_file, shell) != 0)
-        {
-          argv[0] = (char *)exec_file;
-          return start_child (shell, argv, reading, c2p, writing, p2c,
-                              infd, outfd, errfd);
-        }
-    }
-
   errno = errno_save;
   return pid;
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]