summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/spawn.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* * child_info.h (_CI_SAW_CTRL_C): New enum.Christopher Faylor2006-05-221-2/+3
| | | | | | | | | | | | | | | | | (CURR_CHILD_INFO_MAGIC): Reset. (saw_ctrl_c): New function. (set_saw_ctrl_c): Ditto. * sigproc.cc (child_info::proc_retry): Return EXITCODE_OK if we get STATUS_CONTROL_C_EXIT and we actually saw a CTRL-C. * spawn.cc (dwExeced): Delete. (chExeced): New variable. (spawn_guts): Set chExeced; * exceptions.cc (dwExeced): Delete declaration. (chExeced): Declare. (ctrl_c_handler): Detect if we're an exec stub process and set a flag, if so. * fhandler_tty.cc (fhandler_tty_common::__release_output_mutex): Add extra DEBUGGING test. * pinfo.cc: Fix comment.
* * debug.cc (add_handle): Print handle value when collision detected.Christopher Faylor2006-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * dtable.cc (dtable::stdio_init): Cosmetic change. * fhandler.h (fhandler_base::create_read_state): Protect handle. (fhandler_pipe::create_guard): Ditto. Always mark the handle as inheritable. (fhandler_pipe::is_slow): Return boolean value rather than numeric 1. * pipe.cc (fhandler_pipe::fhandler_pipe): Always flag that we need fork fixup. (fhandler_pipe::open): Don't pass security attributes to create_guard. (fhandler_pipe::set_close_on_exec): Don't handle guard here. (fhandler_pipe::close): Accommodate now-protected guard handle. (fhandler_pipe::fixup_in_child): Don't proected read_state here. (fhandler_pipe::fixup_after_exec): Close guard handle if close_on_exec. (fhandler_pipe::fixup_after_fork): Don't bother with guard here. (fhandler_pipe::dup): Don't set res to non-error prematurely. Use boolean values where appropriate. Protect guard and read_state. (fhandler_pipe::create): Don't call need_fork_fixup since it is now the default. Don't protect read_state or guard. * pipe.cc (fhandler_base::ready_for_read): Use bool values for "avail". * spawn.cc (spawn_guts): Set cygheap->pid_handle as inheritable when protecting. * select.cc (fhandler_pipe::ready_for_read): Actually get the guard mutex for blocking reads.
* * spawn.cc (spawn_guts): Move ch.set() call back to where it was supposed toChristopher Faylor2006-04-131-1/+1
| | | | be.
* * spawn.cc (spawn_guts): Revert patch which treated derived cygwin programsChristopher Faylor2006-04-131-3/+4
| | | | | | | | | | | differently from those which are mounted with -X. Pass extra argument to linebuf::fromargv. * winf.h (MAXCYGWINCMDLEN): New define. (linebuf::finish): Add a new argument denoting when command line overflow is ok. (linebuf::fromargv): Ditto. * winf.cc (linebuf::finish): Implement above change. (linebuf::fromargv): Ditto.
* * Makefile.in (DLL_OFILES): Add winf.o.Christopher Faylor2006-04-121-191/+5
| | | | | | * spawn.cc: Move command line handling stuff into winf.cc. * winf.h: New file. * winf.cc: New file.
* * spawn.cc (linebuf::finish): Drop argument. Don't check command lineCorinna Vinschen2006-04-031-10/+5
| | | | | | length. (spawn_guts): Remove wascygexec. Check real_path.iscygexec instead. Accommodate change to linebuf::finish.
* * spawn.cc (spawn_guts): Close handles if we know that we will not be seeing aChristopher Faylor2006-03-271-9/+11
| | | | sync event from the child.
* * child_info.h (child_status): Fix typo which made it impossible to setChristopher Faylor2006-03-221-9/+13
| | | | | | | | | | iscygwin. (child_info::isstraced): Booleanize. (child_info::iscygwin): Ditto. * sigproc.cc (child_info::child_info): Minor cleanup of flag setting. * spawn.cc (spawn_guts): Only close_all_files when we know the process has started successfully. * exceptions.cc (init_console_handler): Fix indentation.
* * dcrt0.cc (dll_crt0_0): Call SetErrorMode earlier.Christopher Faylor2006-03-211-3/+9
| | | | | | | | * pinfo.cc (_pinfo::dup_proc_pipe): Reset wr_proc_pipe on failure. Return previous pipe handle. * pinfo.h (_pinfo::dup_proc_pipe): Reflect change to return value. * spawn.cc (spawn_guts): Restore previous proc pipe on retry or if process exits before synchronization.
* * child_info.h (child_status): New enum.Christopher Faylor2006-03-201-1/+1
| | | | | | | | | | | | | | | | | (child_info::flag): Rename from 'straced'. (child_info::isstraced): New function. (child_info::iscygwin): Ditto. (child_info_fork::handle_fork): Reparmize. (child_info_fork::handle_failure): Ditto. (child_info_spawn::handle_spawn): New function. * dcrt0.cc (get_cygwin_startup_info): Use isstraced method. (child_info_spawn::handle_spawn): Define new function from code previously in dll_crt0_0. (dll_crt0_0): Move spawn stuff into handle_spawn. Only call init_console_handler for fork case. * sigproc.cc (child_info::child_info): Set flag appropriately. (child_info::proc_retry): Treat exit code as "funny" if it's a cygwin process. * spawn.cc (spawn_guts): Remove commented out flag setting.
* * child_info.h (CURR_CHILD_INFO_MAGIC): Regenerate.Christopher Faylor2006-03-181-13/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (child_info::retry): Move here from fork subclass. (child_info::exit_code): New field. (child_info::retry_count): Max retry count for process start. (child_info::proc_retry): Declare new function. (child_info_fork::retry): Move to parent. (child_info_fork::fork_retry): Ditto. * dcrt0.cc (child_info::fork_retry): Rename and move. (child_info_fork::handle_failure): Move. (dll_crt0_0): Initialize console handler based on whether we have a controlling tty or not. Avoid nonsensical check for fork where it can never occur. * environ.cc (set_proc_retry): Rename from set_fork_retry. Set retry_count in child_info. (parse_thing): Reflect above change. * exceptions.cc (dummy_ctrl_c_handler): Remove unused variable name. (ctrl_c_handler): Always return TRUE for the annoying CTRL_LOGOFF_EVENT. * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Remove call to init_console_handler. * fhandler_tty.cc (fhandler_tty_slave::open): Just call mange_console_count here and let it decide what to do with initializing console control handling. * fork.cc (fork_retry): Remove definition. (frok::parent): Define static errbuf and use in error messages (not thread safe yet). Close pi.hThread as soon as possible. Protect pi.hProcess as soon as possible. Don't set retry_count. That happens automatically in the constructor now. Accommodate name change from fork_retry to proc_retry. * init.cc (dll_entry): Turn off ctrl-c handling early until we know how it is supposed to be handled. * pinfo.cc (_pinfo::dup_proc_pipe): Remember original proc pipe value for failure error message. Tweak debug message slightly. * sigproc.cc (child_info::retry_count): Define. (child_info::child_info): Initialize retry count. (child_info::sync): Set exit code if process dies before synchronization. (child_info::proc_retry): Rename from child_info_fork::fork_retry. Use previously derived exit code. Be more defensive about what is classified as an error exit. (child_info_fork::handle_failure): Move here from dcrt0.cc. * spawn.cc (spawn_guts): Maintain error mode when starting new process to avoid annoying pop ups. Move deimpersonate call within new loop. Move envblock freeing to end. Loop if process dies prematurely with bad exit code. * syscalls.cc (init_console_handler): Remove hopefully unneeded call to init_console_handler.
* * child_info.h (child_info_fork::handle_failure): Declare new function.Christopher Faylor2006-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | (child_info_fork::retry): New field. * dcrt0.cc (__api_fatal_exit_val): Define. (child_info_fork::handle_failure): Define new function. (__api_fatal): Exit using __api_fatal_exit_val value. * environ.cc (set_fork_retry): Set fork_retry based on CYGWIN environment variable. (parse_thing): Add "fork_retry" setting. * fork.cc (fork_retry): Define. (frok::parent): Reorganize to allow retry of failed child creation if child signalled that it was ok to do so. * heap.cc (heap_init): Signal parent via handle_failure when VirtualAlloc fails. * pinfo.h (EXITCODE_RETRY): Declare. * sigproc.cc (child_info::sync): Properly exit with failure condition if called for fork and didn't see subproc_ready. * spawn.cc (spawn_guts): Use windows pid as first argument. * winsup.h: Remove obsolete NEW_MACRO_VARARGS define. (__api_fatal_exit_val): Declare. (set_api_fatal_return): Define. (in_dllentry): Declare. * exceptions.cc (inside_kernel): Remove unneeded in_dllentry declaration.
* fix typoChristopher Faylor2006-02-201-1/+1
|
* * spawn.cc (av::fixup): Check for .bat and friends specifically now since theseChristopher Faylor2006-02-201-2/+6
| | | | extensions are no longer automatically detected.
* minor comment restructuringChristopher Faylor2006-02-151-2/+2
|
* * path.cc (suffix_scan::lnk_match): Return true beginning withCorinna Vinschen2006-02-031-2/+4
| | | | | | | | | SCAN_APPENDLNK. (suffix_scan::next): Rearrange code to make .lnk append order slightly more deterministic. * spawn.cc (exe_suffixes): Try no suffix before .exe suffix to align evaluation with stat_suffixes. (dll_suffixes): Ditto.
* * spawn.cc (dll_suffixes): Add .exe and "no suffix" to the list.Corinna Vinschen2006-02-011-0/+1
|
* * dlfcn.cc (check_path_access): Call find_exec with FE_DLL option.Corinna Vinschen2006-01-311-11/+15
| | | | | | | | | | | | * path.h (enum fe_types): Add FE_DLL value. * spawn.cc (std_suffixes): Remove. (exe_suffixes): New suffix_info for executing files. (dll_suffixes): New suffix_info for searching shared libraries. (perhaps_suffix): Add opt argument. Use dll_suffixes if FE_DLL option is given, exe_suffixes otherwise. (find_exec): Propagate opt argument to perhaps_suffix. Drop suffix check when testing execute permission. (spawn_guts): Call perhaps_suffix with FE_NADA opt argument.
* * spawn.cc (av::fixup): Remove unused argument.Christopher Faylor2006-01-311-4/+4
| | | | (spawn_guts): Remove capitalization in debugging.
* * spawn.cc (find_exec): Only return files with execute permission setCorinna Vinschen2006-01-311-11/+18
| | | | | | | if ntsec is on. Don't check execute permission of Windows batch files. (av::fixup): Handle empty files gracefully. Drop execute permission test here. * path.cc (suffix_scan::next): Don't skip any suffix on first run.
* * spawn.cc (spawn_guts): Fix potential handle leak when failing exec.Christopher Faylor2006-01-271-1/+2
|
* * exceptions.cc (inside_kernel): Fix to return true if we can't get the name ofChristopher Faylor2006-01-271-0/+1
| | | | the DLL for the given memory block since we are not in kernel code.
* * Update copyrights.Corinna Vinschen2006-01-121-1/+1
|
* * fhandler.h (set_console_state_for_spawn): Whackamole the argument back to aChristopher Faylor2006-01-121-1/+1
| | | | | | | | | | bool. * spawn.cc (spawn_guts): Ditto, i.e., once again call set_console_state_for_spawn with an indication of whether we're about to start a cygwin process. * fhandler_console.cc (set_console_state_for_spawn): Don't set the console state if we know we're starting a cygwin process or if we're using a "real" tty.
* * spawn.cc (spawn_guts): Reorganize slightly so that 16 bit check is done priorChristopher Faylor2006-01-101-80/+85
| | | | | | | to check for command.com/cmd.com. Don't bother setting CREATE_SUSPENDED flag for a MS-DOS process since it doesn't work anyway. Avoid calling remember() when the child process has already exited. (av::fixup): Explicitly set cygexec flag to falseon a 16 bit process.
* * fhandler.h (set_console_state_for_spawn): Eliminate argument fromChristopher Faylor2006-01-071-1/+1
| | | | | | | | | | declaration. * fhandler.cc (set_console_state_for_spawn): Eliminate argument from definition. Always check for invisible console. (fhandler_console::need_invisible): Don't do anything if the windows station is already not visible. * spawn.cc (spawn_guts): Accommodate change of argument to set_console_state_for_spawn.
* * cygtls.cc (_cygtls::remove): Don't output debugging info if this isn't aChristopher Faylor2006-01-051-1/+1
| | | | cygwin thread.
* * fhandler_process.cc (fhandler_process::readdir): Add missing argument toChristopher Faylor2006-01-041-1/+2
| | | | | | | syscall_printf. * fhandler_console.cc (fhandler_console::need_invisible): Use made-up name for windows station rather than asking Windows to create one for us. * spawn.cc (spawn_guts): Don't mess with console if we're detaching.
* *** cygwin DLL Changes:Christopher Faylor2005-12-291-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * child_info.h (CURR_CHILD_INFO_MAGIC): Reset. (child_info::dwProcessId): Delete. (child_info::straced): New variable. (child_info::handle_fork): New member function. * dcrt0.cc (in_forkee): New global variable. (__cygwin_user_data::forkee): Mark as obsolete. (do_global_ctors): Use in_forkee rather than user_data->forkee. (get_cygwin_startup_info): Ditto. Deal with new straced field to allow strace to deal with children of attached processes. (initial_env): Accommodate changes to strace::hello. (child_info_fork::handle_fork): Rename from plain old 'handle_fork'. Move alloc_stack() call elsewhere. (dll_crt0_0): Fill out more of user_data. Reference handle_fork via fork_info. Add some debugging output. (_dll_crt0): Don't wait for sync thread if sync_startup is invalid. Zero sync_startup here. Call alloc_stack() here, if appropriate. (dll_crt0_1): Use in_forkee rather than user_data->forkee. (dll_crt0): Ditto. * malloc_wrapper.cc (malloc_init): Ditto. * dll_init.cc (in_forkee): Remove local static version of this variable. (dll_list::load_after_fork): Don't set in_forkee here. * external.cc (cygwin_internal): Use strace method rather than accessing field directly. * fhandler.cc (fhandler_base::read): Ditto. * fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Ditto. * fork.cc (frok::parent): Invoke strace write_childpid to communicate with potential strace. (child_copy): Add more detail to debugging output. * init.cc (calibration_id): New static variable. (prime_threads): Set sync_startup to invalid handle if we already know about thread_func_ix. Use static calibration_id to hold calibration thread id. * munge_threadfunc (munge_threadfunc): Don't try to debug if we don't find threadfunc_ix. (dll_entry): Avoid calling munge_threadfunc and _cygtls::remove on non-cygwin threads invoked during process startup. * pinfo.cc (set_myself): Always call strace.hello here regardless of DEBUGGING. * sigproc.cc (child_info::child_info): Remove spurious handling of dwProcessId. Set straced as appropriate. * spawn.cc (spawn_guts): Rename ciresrv to ch. Invoke strace write_childpid to communicate with potential strace. * strace.cc: Include child_info.h. (strace::hello): Remove inited test. Use active() method to test if strace has been activated. Handle case where we are started before (mypid): New function. (strace::vsprntf): Try to deal more intelligently with case where progname may not be filled out. Put pid in parentheses if it is a windows pid rather than a cygwin pid. myself has been filled out. (strace::write_childpid): New function for notifying strace about the creation of children. (strace::vprntf): Use strace method rather than accessing field directly. (strace_printf): Ditto. (strace::wm): Ditto. * winsup.h (in_forkee): Declare. * include/sys/strace.h (strace::write_childpid): Declare new function. (strace::attached): Define new function. (strace::active): Ditto. (strace::active_val): Ditto. (_STRACE_ON): Delete. (_STRACE_OFF): Ditto. (define_strace0): Use strace method rather than accessing field directly. (strace_printf_wrap): Ditto. (strace_printf_wrap1): Ditto. *** cygwin utils changes: * strace.cc (nprocesses): Make static global. (quiet): New variable. (strace_active): Ditto. (add_child): Increment nprocesses here. Don't add a child if it is already added (windows bug?). Report on child if not quiet. (get_child): Just return NULL if child not found. (remove_child): Report on child if not quiet. (attach_process): Don't complain if given a windows process. Use windows pid in error. (handle_output_debug_string): Issue error if trying to manipulate a process that we don't know about. Handle _STRACE_CHILD_PID - attach to reported child when we get this. (proc_child): Move nprocesses to file scope. Report on exceptions. (longopts): Implement "--quiet". (opts): Implement "-q". (main): Manipulate quiet flag. * utils.sgml (strace): Add words describing '-q'.
* * spawn.cc (spawn_guts): Hide the window whenever ctty == -1, not just when weChristopher Faylor2005-12-211-1/+1
| | | | have no console.
* * cygheap.cc (init_cygheap::manage_console_count): Revert previous change.Christopher Faylor2005-12-211-3/+11
| | | | | | | | | | | | | Handle this a different way. * external.cc (cygwin_internal): Accommodate extra hook_or_detect_cygwin argument. * hookapi.cc (cygwin_internal): Fill in subsys variable with the subsystem of the executable. * spawn.cc (av::iscui): New variable. (spawn_guts): Hide window when we don't have a console and this isn't NT/XP/2003. (av::fixup): Set iscui flag. * winsup.h (hook_or_detect_cygwin): Accommodate extra argument.
* * fhandler.h (set_console_state_for_spawn): Add an argument to the declaration.Christopher Faylor2005-12-191-2/+1
| | | | | | | | * fhandler_console.cc (set_console_state_for_spawn): Ditto for the definition. Only set invisible console for non-cygwin process. Remove debugging leftover. * spawn.cc (spawn_guts): Pass argument denoting whether this is a cygwin process to set_console_state_for_spawn and only call this function when exec'ing.
* * fhandler.h (fhandler_pipe::fixup_in_child): Declare new function.Christopher Faylor2005-12-191-11/+16
| | | | | | | | | | | | | | | | | | | | | | (fhandler_console::invisible_console): Declare new variable. (fhandler_console::need_invisible): Ditto. (fhandler_console::has_a): Ditto. * fhandler_console.cc (set_console_state_for_spawn): Eliminate return value. Set up an invisible console if necessary prior to spawning. (fhandler_console::invisible_console): Define. * fhandler_tty.cc (fhandler_tty_slave::open): Use fhandler_console::invisible_console to setup an invisible console. * pipe.cc (fhandler_pipe::fixup_in_child): Define new function from fixup_after_exec. (fhandler_pipe::fixup_after_exec): Use fixup_in_child when appropriate. (fhandler_pipe::fixup_after_fork): Ditto. * spawn.cc (handle): Reorganize and modernize a little. (spawn_guts): Rely on set_console_state_for_spawn to set the console into the right state but don't create the process with "detached" flag if we have no controlling tty since that confuses 'cmd'. * dtable.cc (dtable::stdio_init): Don't set console as controlling terminal if we have an invisible console. * sigproc.cc (child_info::sync): Use correct name in ForceCloseHandle1.
* * exceptions.cc (signal_exit): Eliminate setting of main thread priority sinceChristopher Faylor2005-10-291-1/+3
| | | | | | | | process lock should make that unnecessary. * fork.cc (stack_base): Eliminate. (frok::parent): Subsume stack_base and just set stack stuff here. Report on priority class in debugging output. * spawn.cc (spawn_guts): Report on priority class in debugging output.
* * spawn.cc (spawn_guts): Don't leave the function with return insideCorinna Vinschen2005-10-241-2/+4
| | | | pthread cleanup brackets.
* * sigproc.cc (child_info::sync): Move check for !wr_proc_pipe lower.Christopher Faylor2005-10-191-1/+1
| | | | * spawn.cc (spawn_guts): Correct check for top-level process.
* * sigproc.cc (child_info::sync): Use correct name when closing to preventChristopher Faylor2005-10-181-0/+1
| | | | | | warnings when DEBUGGING. * spawn.cc (spawn_guts): Set myself.hProcess to pi.hProcess since this may have been zeroed by the previous sync.
* Change process_lock to lock_process throughout. Change all calls to newChristopher Faylor2005-10-171-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | cygthread to handle extra argument, throughout. * cygthread.h (cygthread::callproc): Declare new method. (cygthread::cygthread): Add optional length argument to allow copying arguments to executing thread. * cygthread.cc (cygthread::callproc): Define new method. (cygthread::stub): Use callfunc to invoke thread func to allow potentially allocating stack memory which will be returned. (cygthread::simplestub): Ditto. (cygthread::cygthread): Accept arglen argument. Reset ev here prior to activating thread. Wait for ev after activating thread if we're copying contents to the thread. Wait until the end before setting h, to allow thread synchronization. (cygthread::release): Don't reset ev here. Rely on that happening the next time the thread is activated. * pinfo.h (commune_process): Rename declaration from _pinfo::commune_process. * pinfo.cc (commune_process): Ditto for definition. Modify slightly to allow running as a separate cygthread. * sigproc.cc (child_info::sync): Always wait for both subproc_ready and any hProcess if we have a cygwin parent. (talktome): Change argument to be a pointer to siginfo_t. Contiguously allocate whole siginfo_t structure + any needed extra for eventual passing to commune_process thread. (wait_sig): Accommodate change in talktome argument. * pipe.cc (fhandler_pipe::fixup_after_exec): Remove debugging.
* * spawn.cc (av::fixup): Just blindly run any file if it has a .bat or .cmdChristopher Faylor2005-09-201-1/+2
| | | | extension.
* * environ.cc (build_env): Use "kilo"bytes not "mega"bytes. Return immediatelyChristopher Faylor2005-09-161-0/+1
| | | | | on error. * spawn.cc (spawn_guts): Set return value to -1 on error from build_env.
* * environ.cc (build_env): Clear envblock and return NULL on attempt to use envChristopher Faylor2005-09-161-0/+5
| | | | | var > 32K. * spawn.cc (spawn_guts): Set E2BIG if build_env detects an error.
* * sigproc.cc (no_signals_available): Return true if sending to self from theChristopher Faylor2005-09-161-10/+1
| | | | | | | | signal thread. (wait_sig): Correct so that WaitForSingleObject is called when hMainThread is != 0, rather than the reverse. * cygheap.cc (cygheap_fixup_in_child): Clarify potential error message. * fork.cc (fork_copy): Cosmetic change.
* * spawn.cc (av::fixup): Avoid breaking out of the wrong "loop".Christopher Faylor2005-09-151-19/+18
|
* * hookapi.cc (hook_or_detect_cygwin): Simplify very slightly.Christopher Faylor2005-09-151-10/+29
| | | | | * spawn.cc (av::fixup): Guard against problems reading an executable which does not match Microsoft's documentation about PE format.
* * spawn.cc (av::error): Eliminate.Christopher Faylor2005-09-141-22/+16
| | | | | | | | | | (av::av): Remove reference to error. (av::replace0_maybe): Ditto. (av::dup_maybe): Ditto. (av::dup_all): Ditto. (av::unshift): Ditto. (spawn_guts): On a fault, return E2BIG only if ENOMEM has been set. Otherwise return EFAULT.
* * heap.cc (heap_init): Be slightly more aggressive when trying to allocateChristopher Faylor2005-09-101-16/+22
| | | | | | | | | | heap. Change fatal error to avoid confusion with cygheap. * spawn.cc (linebuf::finish): New function. (linebuf::add): Cosmetic change. (spawn_guts): Only avoid building windows command line if the program being executed was actually mounted with -X. Don't return E2BIG if we hit the 32K size and we're executing a detected cygwin program. Just silently truncate the windows command line, instead.
* * hookapi.cc (rvadelta): Change argument to DWORD to eliminate a compilerChristopher Faylor2005-09-081-12/+8
| | | | | | | | | | warning. * path.h (path_conv::set_cygexec): New function. * spawn.cc (av::iscygwin): Eliminate. (av::av): Don't initialize iscygwin. (spawn_guts): Just use real_path.iscygexec for all tests. (av::fixup): Short circuit test if .exe extension and known cygexec. Set cygexec flag appropriately if we find that program uses cygwin1.dll.
* * dcrt0.cc (initial_env): Don't attempt stracing if dynamically loaded.Christopher Faylor2005-09-071-5/+9
| | | | | | | | | | | | | | | (dll_crt0_0): Move console initialization earlier. * init.cc (dll_entry): Move console initialization here. * exceptions.cc (init_console_handler): Fully remove any old console handler. * spawn.cc (spawn_guts): Don't fill out windows argv if we've deduced that this is a cygwin-using program. (av::fixup): Always check executables to see if they are using cygwin1.dll. Don't consider .com files to be scripts. * hookapi.cc (rvadelta): New function. (PEHeaderFromHModule): Simplify slightly. (hook_or_detect_cygwin): Use passed in name argument for "HMODULE" rather than incorrectly reading current program. Calculate delta needed to read image data and file names if this isn't a real "HMODULE".
* * cygheap.cc (cygheap_init): Eliminate debugging #if.Christopher Faylor2005-09-051-1/+4
| | | | | | | | | | * fork.cc (fork_parent): Don't issue errors if "somebody" has set the PID_EXITED flag on a child. Don't close process handle if it has potentially already been closed. * pinfo.cc (winpids::add): Eliminate PID_ALLPIDS handling which was obsoleted by previous changes. * spawn.cc (av::fixup): Do win16 detection for .com files. Make sure that buffer has been unmapped in all cases.
* * spawn.cc (perhaps_suffix): Record errno-type error value in third argument.Christopher Faylor2005-08-241-8/+21
| | | | | (find_exec): On error, set errno returned from perhaps_suffix. (spawn_guts): Ditto.