Skip to content
Snippets Groups Projects
  • Nat Goodspeed's avatar
    78816bb1
    IQA-463: Use APR file I/O for downloaded viewer installer .exe. · 78816bb1
    Nat Goodspeed authored
    On Windows, calling CreateProcess(bInheritHandles=FALSE) is the wrong idea. In
    that case, CreateProcess() passes NO handles -- even the files you've
    explicitly designated as the child's stdin, stdout, stderr in the STARTUPINFO
    struct! Remove LLProcess code to tweak bInheritHandles; we should also remove
    the corresponding (useless) APR extension.
    Instead, given that the Windows file-locking problem we've observed is
    specific to the viewer installer .exe file downloaded by the background
    updater logic, use APR file I/O for that specific file. Empirically, both
    llofstream and std::ofstream seem to make the open file handle inheritable;
    but apr_file_open() documentation says: "By default, the returned file
    descriptor will not be inherited by child processes created by
    apr_proc_create()." And indeed, it does appear to sidestep the locking problem.
    78816bb1
    History
    IQA-463: Use APR file I/O for downloaded viewer installer .exe.
    Nat Goodspeed authored
    On Windows, calling CreateProcess(bInheritHandles=FALSE) is the wrong idea. In
    that case, CreateProcess() passes NO handles -- even the files you've
    explicitly designated as the child's stdin, stdout, stderr in the STARTUPINFO
    struct! Remove LLProcess code to tweak bInheritHandles; we should also remove
    the corresponding (useless) APR extension.
    Instead, given that the Windows file-locking problem we've observed is
    specific to the viewer installer .exe file downloaded by the background
    updater logic, use APR file I/O for that specific file. Empirically, both
    llofstream and std::ofstream seem to make the open file handle inheritable;
    but apr_file_open() documentation says: "By default, the returned file
    descriptor will not be inherited by child processes created by
    apr_proc_create()." And indeed, it does appear to sidestep the locking problem.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.