Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2002-09-19* cygthread.cc (cygthread::initialized): Avoid copying on fork or some threadsChristopher Faylor
may not end up in the pool. (cygthread::new): Avoid race when checking for initialized. Add debugging code. * fhandler.cc (fhandler_base::raw_read): Add case for ERROR_INVALID_HANDLE due to Win95 directories. (fhandler_base::open): Handle errors due to Win95 directories. (fhandler_base::close): Add get_nohandle () test. (fhandler_base::set_close_on_exec): Ditto. (fhandler_base::fork_fixup): Ditto. (fhandler_base::lock): Change error code to Posix EINVAL. (fhandler_base::dup): If get_nohandle (), set new value to INVALID_HANDLE_VALUE instead of NULL. * fhandler_disk_file.cc (fhandler_disk_file::fstat): Call fstat_by_name if get_nohandle (). Remove extraneous element from strpbrk. (fhandler_disk_file::open): Remove test for Win95 directory. * fhandler_random.cc (fhandler_dev_random::open): Add set_nohandle (). * fhandler_clipboard.cc (fhandler_dev_clipboard::open): Ditto. * fhandler_zero.cc (fhandler_dev_zero::open): Ditto. (fhandler_dev_zero::close): Delete. * fhandler.h (class fhandler_dev_zero): Ditto.
2002-07-03* dtable.cc (cygwin_attach_handle_to_fd): Default to implicit bin mode if noneChristopher Faylor
specified. * fhandler.cc (fhandler_base::init): Make bin argument a guarantee rather than a suggestion. * path.cc (path_conv::check): Load flag returned from cygwin_conv_to_win32_path into path_flags.
2002-07-03* cygheap.cc (init_cheap): Rearrange error message.Christopher Faylor
(cygheap_fixup_in_child): Ditto. * dtable.cc: Remove if 0'ed code. * fhandler_dsp.cc (fhandler_dev_dsp::open): Force binmode. * sec_helper.cc (cygsid::get_id): Use system_printf for error message. * tty.cc (tty::common_init): Ditto.
2002-06-25* dtable.cc (dtable::find_unused_handle): Avoid coercion.Christopher Faylor
2002-06-25* dtable.cc (fhandler_base::dup2): Cleanup. Ensure that lock is turned off inChristopher Faylor
error condition.
2002-06-17* cygheap.h (cygheap_user::issetuid): New method.Christopher Faylor
* dtable.cc (dtable::vfork_child_dup): Use new method to determine if we are in "setuid mode." * fork.cc (fork_parent): Ditto. * spawn.cc (spawn_guts): Ditto. * syscalls.cc (seteuid32): Ditto. (setegid32): Ditto. * environ.cc (spenv::retrieve): (Suggested by Pierre Humblet) Do potential recalculation of cygheap_user stuff when in setuid mode. Return special value when environment variable exists but should not be added. (build_env): Don't add retrieved value to dstp if it is 'dont_add'.
2002-06-11* Makefile.in: Ensure that -MD gets added to CFLAGS regardless of CFLAGSChristopher Faylor
command-line setting. * cygwin.din: Export sexec* functions as function which returns ENOSYS (i.e., sexec* is deprecated). * dtable.cc (dtable::vfork_child_dup): Ensure that impersonation is restored even on failure. * exec.cc: Throughout, remove references to sexec* and _spawnve. * pinfo.h: Remove _spawnve declaration. * spawn.cc: Rename _spawnve to spawnve and use throughout. (spawn_guts): Eliminate hToken argument and processing of same. Just perform special actions if impersonating. (spawnve): Rename from _spawnve.
2002-06-07* autoload.cc (noload): Correctly save argument count register.Christopher Faylor
2002-06-05* dtable.cc (handle_to_fn): Check error return value from NtQueryObject firstChristopher Faylor
before seeing if name buffer is NULL. * grp.cc (read_etc_group): Fix gcc warning regarding snprintf format. * passwd.cc (read_etc_passwd): Ditto.
2002-06-05* dtable.cc (handle_to_fn): Attempt to handle "raw" accesses to remote shares.Christopher Faylor
* path.cc (mount_info::conv_to_win32_path): Set flags to binary when mount entry is not found. (mount_info::set_flags_from_win32_path): Ditto.
2002-06-05* dtable.cc (handle_to_fn): Correct placement and length of name buffer.Christopher Faylor
(Suggested by Pavel Tsekov)
2002-06-05Remove fcntl.h includes throughout.Christopher Faylor
* fhandler.h: Move fcntl.h include here. (fhandler_base::set_flags): Accept supplied_bin argument. Make non-inlined. * dtable.cc (dtable::init_std_file_from_handle): Just use binmode from pc. (reset_to_open_binmode): Use set_flags. * cygwin.din (open): Avoid newlib wrapper. (read): Ditto. (unlink): Ditto. (write): Ditto. * fhandler.cc (fhandler_base::set_flags): Accept supplied_bin argument. Make binmode decisions here. (fhandler_base::open): Avoid using pc if it is NULL. Eliminate binmode logic. Just call set_flags with binmode argument. (fhandler_base::init): Call set_flags with binmode argument. * fhandler_clipboard.cc (fhandler_dev_clipboard::open): Ditto. * fhandler_console.cc (fhandler_console::open): Ditto. (fhandler_console::init): Force binary on open. * fhandler_disk_file.cc (fhandler_disk_file::open): Don't set binmode here. Let it happen in base class. * fhandler_dsp.cc (fhandler_dev_dsp::open): Force binmode open. Set return value appropriately if unable to open. * fhandler_proc.cc (fhandler_proc::open): Make sure flags are set before open_status. * fhandler_process.cc (fhandler_process::open): Ditto. * fhandler_registry.cc (fhandler_registry::open): Ditto. * fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Ditto. * fhandler_raw.cc (fhandler_dev_raw::open): Force O_BINARY by default. * fhandler_serial.cc (fhandler_serial::init): Ditto. * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. (fhandler_pty_master::open): Ditto. * fhandler_virtual.cc (fhandler_virtual::open): Ditto. * fhandler_windows.cc (fhandler_windows::open): Ditto. * fhandler_zero.cc (fhandler_dev_zero::open): Ditto. * net.cc (fdsock): Ditto. * path.cc (path_conv::check): Avoid checking for extension when error or directory. (set_flags): Set PATH_TEXT explicitly, when appropriate. (mount_info::conv_to_win32_path): Use set_flags() to set path flags. * path.h (PATH_TEXT): New enum. (path_conv::binmode): Return appropriate constant based on binmode. * pipe.cc (make_pipe): Set binmode to O_TEXT xor O_BINARY. * syscalls.cc (setmode_helper): Make debugging message a little clearer. (setmode): Set binmode via set_flags.
2002-06-02* dtable.cc (handle_to_fn): Use largest match for device. CorrectlyChristopher Faylor
(?) deal with remote drive weirdness.
2002-06-02Remove unneeded sigproc.h includes throughout.Christopher Faylor
* fhandler.h (fhandler_proc::fill_filebuf): Take a pinfo argument. * fhandler_proc.cc (fhandler_proc::get_proc_fhandler): Simplify search for given pid. (fhandler_proc::readdir): Assume that pid exists if it shows up in the winpid list. * fhandler_process.cc (fhandler_process::open): Simplify search for given pid. Call fill_filebuf with pinfo argument. (fhandler_process::fill_filebuf): Pass pinfo here and assume that it exists. * pinfo.h (pinfo::remember): Define differently if sigproc.h is not included. * dll_init.cc (dll_list::detach): Don't run destructor on exit.
2002-06-01* fhandler_console.cc (fhandler_console::open): Reinstate setting of flags.Christopher Faylor
2002-05-29* dtable.cc (dtable::init_std_file_from_handle): Attempt stronger detection ofChristopher Faylor
invalid handle. (handle_to_fn): Detect pathological condition where NT resets the buffer pointer to NULL on an invalid handle.
2002-05-28* autoload.cc (LoadFuncEx): Define via new LoadFuncEx2 macro.Christopher Faylor
(LoadFuncEx2): Adapted from LoadFuncEx. Provides control of return value for nonexistent function. (NtQueryObject): Declare. (IsDebuggerPresent): Declare via LoadFuncEx2 and always return true if not available. * debug.h (being_debugged): Just rely on IsDebuggerPresent return value. * dtable.cc (handle_to_fn): New function. (dtable::init_std_file_from_handle): Attempt to derive std handle's name via handle_to_fn. (dtable::build_fhandler_from_name): Fill in what we can in path_conv structure when given a handle and path doesn't exist. * fhandler.cc (fhandler_base::open): Don't set the file pointer here. Use pc->exists () to determine if file exists rather than calling GetFileAttributes again. * fhandler.h (fhandler_base::exec_state_isknown): New method. (fhandler_base::fstat_helper): Add extra arguments to declaration. (fhandler_base::fstat_by_handle): Declare new method. (fhandler_base::fstat_by_name): Declare new method. * fhandler_disk_file (num_entries): Make __stdcall. (fhandler_base::fstat_by_handle): Define new method. (fhandler_base::fstat_by_name): Define new method. (fhandler_base:fstat): Call fstat_by_{handle,name} as appropriate. (fhandler_disk_file::fstat_helper): Accept extra arguments for filling out stat structure. Move handle or name specific stuff to new methods above. (fhandler_disk_file::open): Use real_path->exists rather than calling GetFileAttributes again. * ntdll.h (FILE_NAME_INFORMATION): Define new structure. (OBJECT_INFORMATION_CLASS): Partially define new enum. (OBJECT_NAME_INFORMATION): Define new structure. (NtQueryInformationFile): New declaration. (NtQueryObject): New declaration. * path.cc (path_conv::fillin): Define new method. * path.h (path_conv::fillin): Declare new method. (path_conv::drive_thpe): Rename from 'get_drive_type'. (path_conv::volser): Declare new method. (path_conv::volname): Declare new method. (path_conv::root_dir): Declare new method. * syscalls.cc (fstat64): Send real path_conv to fstat as second argument.
2002-05-27* debug.h (being_debugged): New macro.Christopher Faylor
* dtable.cc (dtable::extend): Use new macro. * exceptions.cc (try_to_debug): Ditto. * strace.cc (strace::hello): Only output debugging info when we think we're being debugged.
2002-05-25Remove unneeded sync.h, where appropriate, throughout. Remove unneeded heap.h,Christopher Faylor
where appropriate, throughout. Remove unneeded exceptions.h, where appropriate, throughout. Remove unneeded perprocess.h, where appropriate, throughout.
2002-05-24* dtable.cc (dtable::build_fhandler_from_name): Just pass posix path along toChristopher Faylor
set_name via return_and_clear_normalized_path. (dtable::build_fhandler): New method with const char * argument. (dtable::reset_unix_path_name): Eliminate. (dtable::dup_worker): Use correct build_fhandler method. * mmap.cc (mmap_record::alloc_fh): Ditto. * dtable.h (dtable::build_fhandler): New method. (dtable::reset_unix_path_name): Eliminate. * fhandler.cc (fhandler_base::set_name): Assume that unix_name has already been cmalloced. (fhandler_base::reset_unix_path_name): Eliminate. (fhandler_base::~fhandler_base): Coercion for cfree. * fhandler.h (fhandler_base::unix_path_name): Make const char *. (fhandler_base::win32_path_name): Ditto. (fhandler_base::reset_unix_path_name): Eliminate. * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Accommodate const char *ness of win32_path_name. * fhandler_socket.cc (fhandler_socket::fstat): Accommodate new set_name requirements. * path.cc (path_conv::return_and_clear_normalized_path): New method. (path_conv::clear_normalized_path): Eliminate. (path_conv::~path_conv): Ditto. (path_conv::check): Accommodate new build_fhandler method. * path.h (path_conv::~path_conv): Eliminate. (path_conv::clear_normalized_path): Ditto. (path_conv::return_and_clear_normalized_path): Declare new method.
2002-05-03* fhandler_proc.cc (fhandler_proc::fstat): Use fhandler name rather thanChristopher Faylor
path_conv name. (fhandler_proc::open): Ditto. * fhandler_process.cc (fhandler_process::fstat): Use fhandler name rather than path_conv name. (fhandler_process::open): Ditto. * fhandler_registry.cc (fhandler_registry::fstat): Use fhandler name rather than path_conv name. (fhandler_registry::open): Ditto. * path.cc (path_conv::check): Don't copy posix path when virtual. (mount_info::conv_to_win32_path): Don't zero string when isproc. Just derive normal windows path. * path.h (path_conv::clear_normalized_path): Declare new method. * path.cc (path_conv::clear_normalized_path): Define new method. * dtable.cc (build_fhandler_from_name): Clear normalized path when finished to conserve space.
2002-05-02* path.h (pathconv_arg): Add PC_POSIX.Christopher Faylor
(path_conv): Add normalized_path field. * path.cc (path_conv::~path_conv): New destructor. (path_conv::check): Set normalized_path, where appropriate. * dtable.cc (build_fhandler_from_name): Use normalized path from path_conv. * syscalls.cc (chroot): Ditto. * cygheap.h: Remove path_prefix_p declaration. Christopher Faylor <cgf@redhat.com> (minor fixups) * Makefile.in: Add fhandler_proc.o, fhandler_registry.o, fhandler_process.o and fhandler_virtual.o. * dtable.cc (dtable::build_fhandler): Add entries for FH_PROC, FH_REGISTRY and FH_PROCESS. Set unix_name to the normalized posix path. * fhandler.h: Add constants for FH_PROC, FH_REGISTRY and FH_PROCESS. Add class declarations for fhandler_virtual, fhandler_proc, fhandler_registry and fhandler_virtual. Update fhandler_union accordingly. * fhandler_proc.cc: New file. Add implementation for fhandler_proc. * fhandler_virtual.cc: New file. Add implementation for fhandler_virtual. * fhandler_process.cc: New file. Add implementation for fhandler_process. * fhandler_registry.cc: New file. Add implementation for fhandler_registry. * path.cc: Add isproc and isvirtual_dev macros. * path.cc (path_conv::check): Add check for virtual devices. * path.cc (mount_info::conv_to_win32_path): Convert paths in /proc to empty Win32 paths. * path.cc (chdir): Replace check for FH_CYGDRIVE with more generic isvirtual_dev macro. Force setting of posix path for virtual fhandlers. * path.h: Add externally visible path_prefix_p and normalized_posix_path prototypes.
2002-02-22* sync.h (new_muto): Just accept an argument which denotes the name of theChristopher Faylor
muto. Use this argument to construct static storage. * cygheap.cc (cygheap_init): Reflect above change. * exceptions.cc (events_init): Ditto. * malloc.cc (malloc_init): Ditto. * path.cc (cwdstuff::init): Ditto. * cygheap.h (cwdstuff): Change name of lock element to make it less generic. * path.cc (cwdstuff::get_hash): Ditto. (cwdstuff::get_initial): Ditto. (cwdstuff::set): Ditto. (cwdstuff::get): Ditto. * sigproc.cc (proc_subproc): Ditto. * debug.cc (lock_debug): Change to method. Use method rather than macro throughout. * tty.h (tty_min::kill_pgrp): Declare new method. * fhandler_termios.cc (tty_min::kill_pgrp): New method. (fhandler_termios::line_edit): Use new method for killing process. * dcrt0.cc (do_exit): Ditto. * dtable.cc (dtable::get_debugger_info): New method for inheriting dtable info from a debugger. * tty.cc (tty_init): Attempt to grab file handle info from parent debugger, if appropriate. # dtable.cc (dtable::stdio_init): Make this a method. (dtable::init_std_file_from_handle): Don't set fd unless it's not open. (dtable::build_fhandler_from_name): Move name setting to dtable::build_fhandler. (dtable::build_fhandler): Add win32 name parameter. * dcrt0.cc (dll_crt0_1): Change to use dtable stdio_init. * dtable.h (dtable): Reflect build_fhandler parameter change. * mmap.cc (mmap_record::alloc_fh): Don't set name parameter in build_fhandler. * net.cc (fdsock): Remove set_name call since it is now handled by build_fhandler. * sigproc.cc (proc_subproc): Release muto as early as possible.
2002-02-09 * dtable.cc (dtable::dup2): Revert previous patch.Corinna Vinschen
* fhandler.h: Ditto. (fhandler_socket::recv): Define new method. (fhandler_socket::send): Ditto. * fhandler_socket.cc (fhandler_socket::recv): New method. (fhandler_socket::send): Ditto. (fhandler_socket::read): Call fhandler_socket::recv() now. (fhandler_socket::write): Call fhandler_socket::send() now. * net.cc (class wsock_event): Move definition to wsock_event.h. (fdsock): Revert previous patch. (cygwin_recv): Move implementation to fhandler_socket::recv(). (cygwin_send): Move implementation to fhandler_socket::send(). * wsock_event.h: New file.
2002-02-08 * dtable.cc (dtable::dup2): Store fd for fhandler_socket.Corinna Vinschen
* fhandler.h (fhandler_base::set_fd): New virtual method. (fhandler_base::get_fd): Ditto. (fhandler_socket::set_fd): Ditto. (fhandler_socket::get_fd): Ditto. * fhandler_socket.cc (fhandler_socket::read): Call cygwin_recv instead of native Winsock recv. (fhandler_socket::write): Call cygwin_send instead of native Winsock send. * net.cc (fdsock): Store fd in fhandler_socket.
2002-01-13Add copyright stuffChristopher Faylor
2002-01-06* dtable.cc (dtable::init_std_file_from_handle): Add some defensive code toChristopher Faylor
invalid handle case.
2002-01-06 * ioctl.cc (ioctl): Make third argument optional.Corinna Vinschen
* include/sys/ioctl.h: Ditto in declaration. * dtable.cc (dtable::init_std_file_from_handle): Revert previous bogus patch. * window.cc (WndProc): Raise SIGURG instead of SIGIO in case of FD_OOB message.
2002-01-05 * dtable.cc (dtable::init_std_file_from_handle): Don't treat NULLCorinna Vinschen
handle as errorneous.
2001-12-17* dtable.cc (dtable::init_std_file_from_handle): Avoid initializing using anChristopher Faylor
invalid handle.
2001-11-24* dtable.cc (dtable::vfork_parent_restore): Add debugging statement.Christopher Faylor
* exceptions.cc (try_to_debug): Spin only as long as we don't have a debugger attached. * fhandler.h (fhandler_base::set_nohandle): New method. (fhandler_base::get_nohandle): New method. * fhandler.cc (fhandler_base::dup): Avoid duplicating handle if there is no handle. * fhandler_disk_file.cc (fhandler_disk_file::opendir): Set nohandle flag on dummy fd. * Makefile.in: Make intermediate library for eventual inclusion in libcygwin.a * fhandler.h (fhandler_pipe::fhandler_pipe): Remove default argument setting since it is no longer used. * miscfuncs.cc (check_null_str): New function. (+check_null_str_errno): Ditto. * net.cc: Add defensive buffer checking throughout. (cygwin_sendto): Protect against invalid fd. (cygwin_recvfrom): Ditto. (cygwin_getpeername): Ditto. (cygwin_recv): Ditto. (cygwin_send): Ditto. * winsup.h: Declare a new function. * select.cc (set_bits): Fix conditional for setting fd in exceptfds. * dtable.cc (dtable::build_fhandler): Create fhandler_pipe using correct device type. * path.cc (get_devn): Set correct pipe device type from device name.
2001-11-22* path.cc (conv_path_list): Fix wild indexing into path due to conflictingChristopher Faylor
methods for setting src pointer. * dir.cc (opendir): Only pass path_conv argument to opendir, since name is already part of the fhandler. * dtable.cc (dtable::build_fhandler): Accomodate new FH_CYGDRIVE type. * fhandler.cc (fhandler_base::opendir): Nuke name argument. * fhandler.h: Add FH_CYGDRIVE to "device" enum. (fhandler_base::opendir): Nuke name argument. (fhandler_disk_file::opendir): Ditto. (fhandler_disk_file::fhandler_disk_file): Declare new method which passes devtype through. (fhandler_cygdrive): Add elements for tracking drives. (fhandler_cygdrive::set_drives): Declare new method. (fhandler_cygdrive::iscygdrive_root): Declare new method. (fhandler_cygdrive::opendir): Declare new method. (fhandler_cygdrive::readdir): Declare new method. (fhandler_cygdrive::telldir): Declare new method. (fhandler_cygdrive::seekdir): Declare new method. (fhandler_cygdrive::rewinddir): Declare new method. (fhandler_cygdrive::closedir): Declare new method. (fhandler_cygdrive::fstat): Declare new method. * fhandler_disk_file.cc (fhandler_disk_file::fhandler_disk_file): Define new method which passes devtype through. (fhandler_disk_file::open): Tweak debug output. (fhandler_disk_file::opendir): Nuke first argument. Use info from path_conv and class rather than calling fstat. (fhandler_cygdrive::set_drives): New method. (fhandler_cygdrive::iscygdrive_root): New method. (fhandler_cygdrive::opendir): New method. (fhandler_cygdrive::readdir): New method. (fhandler_cygdrive::telldir): New method. (fhandler_cygdrive::seekdir): New method. (fhandler_cygdrive::rewinddir): New method. (fhandler_cygdrive::closedir): New method. (fhandler_cygdrive::fstat): New method. * path.cc (iscygdrive_device): Assume cygdriveness is already verified. (path_conv::check): Treat FH_CYGDRIVE "method" as a special case, setting file attributes as needed. (mount_info::conv_to_win32_path): Allow stand-alone /cygdrive, meaning "the directory which contains all of the drives on the system". (fillout_mntent): Use cyg_tolower for conversions. (mount_info::cygdrive_win32_path): Replace unused argument with unit number. * shared_info.h (mount_info::cygdrive_win32_path): Reflect argument change.
2001-11-10* dtable.cc (dtable::build_fhandler): Don't increment console fd count if newChristopher Faylor
operation fails. Increment fork_fixup field here. (dtable::dup2): Don't increment fork_fixup field here. (fdsock): Ditto.
2001-11-05Eliminate excess whitespace.Christopher Faylor
2001-11-05* dtable.cc (dtable::build_fhandler): Fix debug_printf to avoid SEGV due toChristopher Faylor
incorrect parameter placement.
2001-11-02* dtable.cc (dtable::build_fhandler): Issue internal error on unknown device.Christopher Faylor
* fhandler.cc (fhandler_base::close): Show both name and handle in debugging output. * fhandler.h (fhandler_base::get_guard): New virtual method. (fhandler_pipe::get_guard): New method. (fhandler_socket::ready_for_read): Delete declaration. (fhandler_pipe::ready_for_read): Ditto. (fhandler_serial::ready_for_read): Ditto. (fhandler_console::ready_for_read): Ditto. (fhandler_tty_common::ready_for_read): Ditto. (fhandler_windows::ready_for_read): Ditto. (struct select_record::peek): Declare new method. * select.cc (MAKEready): Delete. (peek_pipe): Use get_guard method to retrieve potential guard mutex handle. (fhandler_base::ready_for_read): Rewrite as generic ready-for-read handler. Should only be called for "slow" devices. (fhandler_socket::ready_for_read): Delete definition. (fhandler_pipe::ready_for_read): Ditto. (fhandler_serial::ready_for_read): Ditto. (fhandler_console::ready_for_read): Ditto. (fhandler_tty_common::ready_for_read): Ditto. (fhandler_windows::ready_for_read): Ditto. (fhandler_pipe::select_read): Fill in new peek record in select_record structure. (fhandler_console::select_read): Ditto. (fhandler_tty_common::select_read): Ditto. (fhandler_serial::select_read): Ditto. (fhandler_socket::select_read): Ditto. (fhandler_socket::select_read): Ditto. (fhandler_tty_slave::ready_for_read): Check for tty not open. Set errnos appropriately. * syscalls.cc (_read): Allow ready_for_read to set errno. * pinfo.cc (pinfo::init): Return spawn/NO_WAIT process as valid if it is initializing. * sigproc.cc (getsem): Adjust wait for process to initialize downward to avoid huge waits.
2001-10-31 * dtable.cc (dtable::vfork_child_dup): Revert impersonationCorinna Vinschen
before duplicating fhandler.
2001-10-30* dtable.cc (dtable::dup2): Add some debugging. Use methods from passed inChristopher Faylor
class rather than cygheap->fdtab. * fhandler_socket.cc (fhandler_socket::fixup_before_fork_exec): Add more debugging output. (fhandler_socket::dup): Allocate new space for prot_info_ptr for duplicated entry. * syscalls.cc (stat_worker): Always delete fh if it has been created.
2001-10-22Remove 'cb' parameter and modify fhandler_* constructors throughout.Christopher Faylor
* dtable.cc (dtable::build_fhandler): Remove debugging output which uses 'cb'. * exec.cc (execvp): New function. (execvpe): Ditto. * fhandler.cc (fhandler_base::fhandler_base): Use constructor initialization. * fhandler.h (fhandler_tty_common::fhandler_tty_common): Ditto. * fhandler_clipboard.cc (fhandler_dev_clipboard::fhandler_dev_clipboard): Ditto. * fhandler_console.cc (fhandler_console::fhandler_console): Ditto. * fhandler_raw.cc (fhandler_dev_raw::fhandler_dev_raw): Ditto. * fhandler_serial.cc (fhandler_serial::fhandler_serial): Ditto. * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Ditto. (fhandler_tty_slave::fhandler_tty_slave): Ditto. (fhandler_pty_master::fhandler_pty_master): Ditto. * fhandler_windows.cc (fhandler_windows::fhandler_windows): Ditto.
2001-10-14* dtable.cc (dtable::build_fhandler_from_name): Use PC_FULL to determine pathChristopher Faylor
name. * fork.cc (fork_parent): Correct the "unable to allocate forker_finished event" error message. It named the wrong event before.
2001-10-14* autoload.cc (load_wsock32): Declare dummy function to force loading ofChristopher Faylor
winsock. * fhandler.cc (fhandler_base::set_inheritance): Make debugging output more verbose. * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Force loading of winsock32 if winsock2 not available. * net.cc (set_socket_inheritance): Use DuplicateHandle in all cases to set inheritance correctly. (fdsock): Use winsock2_active macro to determine when to set socket inheritance. Remove fdtab resource locking since this function should already be protected. (cygwin_accept): Simplify logic. Ensure that fdtab unlock is not called inappropriately. (cygwin_rcmd): Use fdtab locking. (cygwin_rresvport): Ditto. (cygwin_rexec): Ditto. * select.cc (peek_socket): Set errno appropriately if winsock select fails. * winsup.h: Declare check_pty_fds. * syscalls.cc (check_pty_fds): Rename from check_ttys_fds. Also check pty master. (setsid): Use check_pty_fds. * dtable.cc (dtable::dec_console_fds): Add check on pty fds.
2001-10-13* fhandler_dsp.cc (fhandler_dsp::ioctl): Return 0 for successfulChristopher Faylor
SNDCTL_DSP_GETBLKSIZE operation. Remove obsolete 'name' arg from fhandler_* constructors throughout. * winsup.h (winsock_active): New macro. (winsock2_active): Ditto. * autoload.cc (wsock_init): Use new macros to decide if winsock or winsock2 is loaded. (nonexist_wsock32): Dummy function to force winsock load. (nonexist_ws2_32): Dummy function to force winsock2 load. * fhandler.h (fhandler_socket::fstat): Declare new method. Currently unused. * fhandler_socket.cc (fhandler_socket::fixup_before_fork_exec): Check that winsock2 is active before trying WSADuplicateSocketA. (fhandler_socket::fixup_after_fork): Add extra check for winsock2_active. Otherwise use iffy procedures for Windows 95. (fhandler_socket::fixup_after_exec): Add debugging. (fhandler_socket::dup): Add debugging. (fhandler_socket::fstat): New method. (fhandler_socket::set_close_on_exec): Attempt to perform iffy stuff on Windows 95. * errno.cc (_sys_nerr): Work around compiler strangeness. * pinfo.cc (winpids::add): Add extra element at end of allocated array for setting to NULL. (winpids::enumNT): Ditto. (winpids::init): Don't modify pidlist if it hasn't been allocated (possibly due to malloc problem).
2001-10-08* dtable.cc (dtable::build_fhandler): Allocate correct amount for givenChristopher Faylor
fhandler class. * fhandler.h (fhandler_union): Properly define rather than relying on fhandler_console being "big enough".
2001-10-03* cygheap.cc (cfree): Remove malloc debugging probe.Christopher Faylor
* dlmalloc.c (errprint): Remove abort() call which causes interesting error message printing to abort prematurely. * environ.cc: Sprinkle MALLOC_CHECKs liberally throughout. (_addenv): Allocate two empty elements at end of environ to (apparently) work around problems with some buggy applications. (winenv): Avoid calling alloca if no forced environment variable is present. * exceptions.cc (open_stackdumpfile): Don't print "Dumping stack trace to..." when running in a cygwin environment (i.e., the parent is a cygwin process). * dtable.cc (dtable::init_std_file_from_handle): Move device type detection code from build_fhandler here since it is only used by this function. (dtable::build_fhandler_from_name): New method. Renamed from dtable::build_fhandler. (dtable::build_fhandler): Use build_fhandler_from_name. (cygwin_attach_handle_to_fd): Ditto. * syscalls.cc (_open): Ditto. (stat_worker): Ditto. * dtable.h (dtable::build_fhandler_from_name): Rename declaration from dtable::build_fhandler.
2001-10-02* dtable.h (dtable::build_fhandler): Make path_conv parameter non-optional.Christopher Faylor
(dtable::init_std_file_from_handle): Eliminate name parameter. * dtable.cc (stdio_init): Don't pass bogus name to init_std_file_from_handle. The function will figure out the name itself. (dtable::init_std_file_from_handle): Eliminate name parameter. Assume that we're always called with an appropriate fd. Pass name as NULL if we can't simply figure it out from context. (cygwin_attach_handle_to_fd): Pass path_conv argument to build_fhandler. (dtable::build_fhandler): Make path_conv argument mandatory. Eliminate specific call to get_device_number. With unknown device names, set name from handle context for parsing by path_conv. (dtable::build_fhandler): Pass path_conv argument to build_fhandler. * path.h (path_conv::set_isdisk): Set disk device type. (path_conv::is_device): Don't consider FH_DISK a "device". * syscalls.cc (_open): Pass path_conv argument by reference. (stat_worker): Ditto. (_rename): Use path_conv operators. Add bounds to DeleteFile/MoveFile for loop.
2001-10-01Add "path.h" include throughout, where needed. Use new path_conv methods andChristopher Faylor
operators to simplify testing for directory and attributes, throughout. * path.h (path_conv::exists): New method. (path_conv::has_attribute): Ditto. (path_conv::isdir): Ditto. (path_conv::DWORD &): New operator. (path_conv::int &): Ditto. * dir.cc (rmdir): Eliminate a goto. * dtable.cc (dtable::build_fhandler): Accept opt and suffix info for path_conv.check. Return fh == NULL on path_conv error. Pass unit to set_name as appropriate. (dtable::reset_unix_path_name): New method. * dtable.h (dtable): Declare new method. Reflect arg changes to build_fhandler. * fhandler.cc (fhandler_disk_dummy_name): Eliminate. (fhandler_base::set_name): Expect paths to be NULL. Build unix_path_name from win32_path_name when it is a device. (fhandler_base::reset_unix_path_name): New method. (fhandler_base::raw_read): Report EISDIR when ERROR_INVALID_FUNCTION or ERROR_INVALID_PARAMETER and reading a directory. (fhandler_disk_file::fstat): Don't call stat_dev since we should now never be calling fhandler_disk_file methods with devices. (fhandler_base::fhandler_base): Clear {unix,win32}_path_name. (fhandler_base::~fhandler_base): Always free {unix,win32}_path_name. (fhandler_disk_file::fhandler_disk_file): Remove set_no_free_names kludge. (fhandler_disk_file::open): Ditto. * fhandler.h (fhandler_base::no_free_names): Eliminate. (fhandler_base::set_no_free_names): Ditto. * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Don't set unix_path_name here. * path.cc (fchdir): Lock fd table throughout. Use new dtable::reset_unix_path_name method to reset path. * syscalls.cc (stat_worker): Reorganize to always call fstat method. Pass path_conv method to fhandler_*::open. (chroot): Elminate a goto.
2001-09-25* fhandler.h (fhandler_pipe::hit_eof): New method.Christopher Faylor
(writepipe_exists): New class element. (orig_pid): Ditto. (id): Ditto. (is_slow): Eliminate. * pipe.cc (fhandler_pipe::set_close_on_exec): Set inheritance on writepipe_exists, if it exists. (fhandler_pipe::hit_eof): New method, modelled after tty. (fhandler_pipe::dup): Duplicate writepipe_exists, if it exists. (make_pipe): Set up a dummy event for pipes on windows 9x. The nonexistence of this event means that the write side of the pipe has closed. (_dup): Move to syscalls.cc (_dup2): Ditto. * dtable.cc (dtable::build_fhandler): Fill out set_names here, if appropriate. * syscalls.cc (_open): Call set_names in build_fhandler.
2001-09-23 * dtable.cc (dtable::build_fhandler): Initialize unit when usingCorinna Vinschen
optional path_conv argument.
2001-09-23* dtable.cc (dtable::build_fhandler): Accept an optional path_conv argument.Christopher Faylor
If available, use this to calculate path name and device number. * dtable.h (dtable): Reflect above change. * fhandler.h (fhandler_base): Declare virtual method which accepts path_conv rather than path string as first argument. * fhandler.cc (fhandler_base::open): Define above new method. * syscalls.cc (_open): Set aside a path_conv variable for use in build_fhandler and subsequent call to open.
2001-09-12Update copyrights.Christopher Faylor