Ignore:
Timestamp:
Sep 15, 2020, 11:28:37 PM (5 years ago)
Author:
bird
Message:

kash: Introduced asynchronous closing of files we're written to on windows because it may take a while on NTFS. We only need to make sure async CloseHandle are done when executing or forking.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/shinstance.c

    r3464 r3466  
    20912091            {
    20922092                char errmsg[512];
    2093                 rc = nt_child_inject_standard_handles(ProcInfo.hProcess, fdinfo.replacehandles, (HANDLE*)&fdinfo.handles[0],
    2094                                                       errmsg, sizeof(errmsg));
     2093                if (!fdinfo.inherithandles)
     2094                    rc = nt_child_inject_standard_handles(ProcInfo.hProcess, fdinfo.replacehandles,
     2095                                                          (HANDLE *)&fdinfo.handles[0], errmsg, sizeof(errmsg));
     2096                else
     2097                    rc = 0;
    20952098                if (!rc)
    20962099                {
     2100#  ifdef KASH_ASYNC_CLOSE_HANDLE
     2101                    shfile_async_close_sync();
     2102#  endif
    20972103                    rc = ResumeThread(ProcInfo.hThread);
    20982104                    if (!rc)
     
    21212127                if (GetExitCodeProcess(ProcInfo.hProcess, &dwExitCode))
    21222128                {
    2123 #ifndef SH_FORKED_MODE
     2129#  ifndef SH_FORKED_MODE
    21242130                    shsubshellstatus_signal_and_release(psh, (int)dwExitCode);
    2125 #endif
     2131#  endif
    21262132                    CloseHandle(ProcInfo.hProcess);
    21272133                    ProcInfo.hProcess = INVALID_HANDLE_VALUE;
Note: See TracChangeset for help on using the changeset viewer.