incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Black <abl...@roguewave.com>
Subject Re: [patch] exec utility windows port
Date Thu, 17 Aug 2006 21:50:27 GMT
And, take 2 on the patch.  I believe I've resolved the issue with soft 
killing the child processes, but I am not completely happy with it. 
Part of this reason for this unhappiness is that the MSDN documentation 
on process creation flags seems to indicate that the Control-C signal 
handling is disabled on the new process group.  Unfortunately, I don't 
think there's any way around this.  Still, I don't see error messages 
when a child process is killed, so I think it will work.

--Andrew Black

Andrew Black wrote:
> Greetings
> 
> Now that the preparation patch has been applied, I have updated the 
> actual port patch to reflect the current state of subversion.  This 
> patch is attached.  Below is the revised changelog which should reflect 
> the changes made in this iteration of the patch.
> 
> A concern I have about this patch is in the behavior of the soft kill 
> logic.  When I test the child process kill logic (by issuing a command 
> like 'exec.exe -t3 "exec.exe --sleep=10"'), I receive error output 
> similar to the following:
>  > Sending child process Control-C failed with error 87.  Additionally, 
> FormatMessage failed with error 8.
>  > Sending child process Control-Break failed with error 87. 
> Additionally, FormatMessage failed with error 8.
>  From these error messages, I believe that the soft kills aren't being 
> sent to the child process, and I am uncertain as to the reason.  I would 
> appreciate it if someone who has more experience with Windows could look 
> into the problem.  I don't know if this is a big enough issue to stop 
> the patch from going in as it stands, as we are able to hard kill 
> processes, but it is something to consider first.
> 
> --Andrew Black
> 
> Log:
>     * exec.h [_WIN32 || _WIN64] (exec_attrs): Alter structure definition 
> for windows.
>     * exec.cpp [_WIN32 || _WIN64]: Use windows.h and process.h in place 
> of unistd.h and sys/wait.h on windows.
>       [!_WIN32 && !_WIN64] (handle_alrm, wait_for_child, open_input, 
> replace_file, exec_file): Reduce scope of (existing) functions to 
> non-windows platforms only.
>       [_WIN32 || _WIN64] (open_input, merge_argv, warn_last_error, 
> exec_file): Define implementation of named functions for windows 
> platforms only.
>     * cmdopt.cpp [_WIN32 || _WIN64]: Use windows.h in place of unistd.h 
> on windows.
>       (escape_code, default_path_sep, suffix_sep, exe_suffix_len): Alter 
> values for windows.
>       (rw_sleep, rw_signal): Define platform independent wrapper for 
> sleep/Sleep and sigaction/signal.
>       (eval_options): Use above.
>     * runall.cpp [!_WIN32 && !_WIN64]: Don't include sys/wait.h on windows.
>       (S_IXUSR, S_IXGRP, S_IXOTH): Define values if undefined (for 
> windows).
>       (check_target_ok) [_WIN32 || _WIN64]: Make object file comparison 
> operating system specific.
>       (process_results) [_WIN32 || _WIN64]: Make error state processing 
> code operating system specific.
>       (rw_basename) [_WIN32 || _WIN64]: Treat / as an additional path 
> separator on windows.
> 
> Martin Sebor wrote:
>> Andrew Black wrote:
>>> I believe I posted my patch to the list prior to the referenced 
>>> change being submitted to subversion, but I am uncertain why those 
>>> particular hunks failed to apply (running svn up appears to have 
>>> merged them without conflicts).
>>>
>>> Attached is a revised version of the patch that tries to address the 
>>> formatting issues in changed code (a formatting and comment cleanup 
>>> sweep is needed after the windows port is finished).  I have also 
>>> tried to alter the log based on the changes to the patch and the 
>>> referenced link.
>>
>> Great, thank you! Applied as follows:
>> http://svn.apache.org/viewvc?rev=431984&view=rev
>>
>> Martin

Mime
View raw message