Changeset 9728


Ignore:
Timestamp:
Jun 11, 2008, 12:13:48 AM (11 years ago)
Author:
gb
Message:

Windows version of EXEC-WITH-IO-REDIRECTION: new-input, new-output, new-error
can all be NIL, so use fd 0, 1, 2 unless they're set. #get_osfhandle returns
an integer, so coerce its result to a pointer before trying to store it
in the procinfo struct. (The fact that this function runs with a
HANDLER-CASE in effect tends to obscure these mundane errors.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/win64/level-1/linux-files.lisp

    r9657 r9728  
    15231523            (logior #$STARTF_USESTDHANDLES #$STARTF_USESHOWWINDOW))
    15241524      (setf (pref si #>STARTUPINFO.wShowWindow) #$SW_HIDE)
    1525       (setf (pref si #>STARTUPINFO.hStdInput) (#__get_osfhandle new-in))
    1526       (setf (pref si #>STARTUPINFO.hStdOutput) (#__get_osfhandle new-out))
    1527       (setf (pref si #>STARTUPINFO.hStdError) (#__get_osfhandle new-err))
     1525      (setf (pref si #>STARTUPINFO.hStdInput)
     1526            (%int-to-ptr (#__get_osfhandle (or new-in 0))))
     1527      (setf (pref si #>STARTUPINFO.hStdOutput)
     1528            (%int-to-ptr (#__get_osfhandle (or new-out 1))))
     1529      (setf (pref si #>STARTUPINFO.hStdError)
     1530            (%int-to-ptr (#__get_osfhandle (or new-err 2))))
    15281531      (if (zerop (#_CreateProcessW (%null-ptr)
    15291532                                   command
     
    15361539                                   si
    15371540                                   proc-info))
    1538           (error "Process creation failed"))
     1541          (error "Process creation failed: ~d" (#_GetLastError)))
    15391542      (#_CloseHandle (pref proc-info #>PROCESS_INFORMATION.hThread))
    15401543      (pref proc-info #>PROCESS_INFORMATION.hProcess))))
Note: See TracChangeset for help on using the changeset viewer.