https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=9649560bf6b0b89182b82b7f4bc0d00c8ff684ca

commit 9649560bf6b0b89182b82b7f4bc0d00c8ff684ca
Author:     Mark Geisert <[email protected]>
AuthorDate: Fri Mar 13 23:44:34 2026 -0700
Commit:     Corinna Vinschen <[email protected]>
CommitDate: Mon Mar 16 12:02:09 2026 +0100

    Cygwin: Quash Windows error text to user on fork() error
    
    For a very long time, since 2011 or earlier, fork() has printed an internal
    error message when it fails due to a CreateProcess() error.  This patch
    quashes the error message as far as the user can tell, but it will still be
    present in an strace.
    
    This change is a judgement call based on the fact we now support
    RLIMIT_NPROC and so a user limiting the number of subprocesses may hit
    more CreateProcess() errors by design.  Don't clutter the scene.
    
    Fixes: 855108782321 (* dll_init.c (dll_list::load_after_fork): Don't
    clear in_forkee here.)
    Signed-off-by: Mark Geisert <[email protected]>

Diff:
---
 winsup/cygwin/fork.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index 3e5d81fe46e8..48e8b7557d00 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -400,6 +400,7 @@ frok::parent (volatile char * volatile stack_here)
        {
          this_errno = geterrno_from_win_error ();
          error ("CreateProcessW failed for '%W'", myself->progname);
+         ch.silentfail (true);
          dlls.release_forkables ();
          memset (&pi, 0, sizeof (pi));
          goto cleanup;

Reply via email to