Commit Graph

5827 Commits

Author SHA1 Message Date
Christopher Faylor fe66a97ae4 * DevNotes: Add entry cgf-000009.
* smallprint.cc (__small_vsprintf): Always treat '%c' and '%C' as characters.
Don't decode them if they are > 127.
(__small_vswprintf): Ditto.
2012-05-17 02:18:41 +00:00
Christopher Faylor bd8afa5eb1 * DevNotes: Add entry cgf-000008.
* fhandler_tty.cc (bytes_available): Simplify by returning the number of bytes
available in the message unless that is zero.
2012-05-16 01:56:41 +00:00
Christopher Faylor 8f55341ea1 * child_info.h (CURR_CHILD_INFO_MAGIC): Update. 2012-05-14 23:29:03 +00:00
Christopher Faylor 3de7be4c1d * DevNotes: Add entry cgf-000007.
* child_info.h (child_info_spawn::parent_winpid): Declare new field.
(child_info_spawn::get_parent_handle): Declare new function.
* dcrt0.cc (child_info_spawn::get_parent_handle): Define new function.
(child_info_spawn::handle_spawn): Recreate parent handle if possible when
dynamically loaded.  Don't mess with parent handle if it's NULL.
* spawn.cc (child_info_spawn::worker): Set parent_winpid appropriately.
2012-05-14 22:42:56 +00:00
Christopher Faylor 1f99484812 * DevNotes: Add entry cgf-000006.
* thread.cc (pthread::pop_cleanup_handler): Set cancel state to disabled to
avoid recursively waiting for cancel.
2012-05-12 20:26:43 +00:00
Christopher Faylor 348b56b5a3 * DevNotes: Add entry cgf-000005.
* fhandler.h (PIPE_ADD_PID): Redefine to something we actually DON'T use.
* pipe.cc (fhandler_pipe::create): Avoid clearing all open_mode bits when
checking for PIPE_ADD_PID.  Properly keep track of len so that passed in name
is not overwritten.
2012-05-12 19:17:17 +00:00
Corinna Vinschen 3ebb4f04b5 * cygwin.din (memrchr): Export.
* posix.sgml (std-gnu): Add memrchr.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2012-05-10 08:35:22 +00:00
Corinna Vinschen 3ef81a86fb * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 16. 2012-05-10 06:51:40 +00:00
Christopher Faylor dfd5d5bea6 * DevNotes: Add entry cgf-000004.
* pinfo.cc (pinfo::init): Reuse shared memory if the state is marked with
PID_REAPED.
* spawn.cc (child_info_spawn::worker): Don't duplicate myself_pinfo into
non-cygwin child.
* fork.cc (frok::parent): Improve error output.
2012-05-08 15:06:43 +00:00
Christopher Faylor 06bd0ef2ab * DevNotes: Add entry cgf-000003.
* cygheap.h (init_cygheap::pid_handle): Delete.
* dcrt0.cc (child_info_spawn::handle_spawn): Keep parent open if we have
execed.
* pinfo.cc (pinfo::thisproc): Remove pid_handle manipulations.
(pinfo::init): Don't consider a reaped process to be available.
* spawn.cc (child_info_spawn::worker): Remove pid_handle manipulations.  Make
wr_proc_pipe and parent noninheritable when starting a program which doesn't
use the Cygwin DLL.  Conditionally reset wr_proc_pipe to inheritable if
CreateProcess fails.  Inject wr_proc_pipe handle into non-Cygwin process.
Consider a non-cygwin process to be 'synced'.
2012-05-07 15:05:56 +00:00
Christopher Faylor fb9d631817 * DevNotes: Add entry cgf-000002.
* fhandler_tty.cc (bytes_available): Revert to previous Oct-2011 behavior where
a dummy buffer is used to determine how many bytes will be read.
(fhandler_pty_master::ioctl): Correct coercion in assignment.
2012-05-04 03:00:43 +00:00
Corinna Vinschen 00a76ece10 * net.cc (get_adapters_addresses): Only create thread on affected
systems.  Change comment acordingly.
	* wincap.h (wincaps::has_gaa_largeaddress_bug): New element.
	* wincap.cc: Implement above element throughout.
	(wincap_8): New globale wincaps to support Windows 8.
	(wincapc::init): Take Windows 8 into account.  Set new
	has_gaa_largeaddress_bug member to false on 32 bit systems.
2012-05-03 08:34:44 +00:00
Christopher Faylor 287a26f349 Reflect ChangeNotes -> DevNotes 2012-05-02 20:39:31 +00:00
Christopher Faylor b79c0094f8 * ChangeNotes: New file. Add entry cgf-000001.
* sigproc.cc (proc_terminate): Don't set parent pid of child to 1 if we've
execed since the execed process is still considered the parent.
* child_info.h: Bump copyright.
2012-05-02 16:39:39 +00:00
Corinna Vinschen 6f5a3401aa * fenv.cc (fesetround): Fix test for valid input parameter.
(fesetprec): Ditto.
2012-05-02 07:42:08 +00:00
Christopher Faylor 28c8ae66d5 * fhandler.h (PIPE_ADD_PID): Define new flag.
* pipe.cc (fhandler_pipe::create): Don't indiscriminately add process id to
every pipe since some pipe names (fifo, tty) don't need it.
* sigproc.cc (sigproc_init): Pass PIPE_ADD_PID to fhandler_pipe::create to
ensure that pid is always part of sigwait pipe name.
2012-04-30 15:38:45 +00:00
Christopher Faylor ea17849f8b * environ.cc (struct parse_thing): Add temporary (?) "pipe_byte" option.
* globals.cc (pipe_byte): Declare.
* pipe.cc (fhandler_pipe::create): Use current process id in pipe name rather
than pid for simple name collision avoidance.  Do this only once to avoid extra
overhead when a busy pipe is found.  Honor pipe_byte to create non-message
pipes if set.
* sigproc.cc (sigproc_init): Use a specific name for the signal pipe.
2012-04-28 19:49:58 +00:00
Corinna Vinschen 2d487f2dd6 * path.cc (find_fast_cwd_pointer): Fix for W8 CP 32 bit. 2012-04-27 12:07:15 +00:00
Corinna Vinschen 8ee7527dc2 * fhandler.h (class dev_console): Add member ext_mouse_mode5.
* fhandler_console.cc (fhandler_console::read): Implement extended
	mouse mode 1005 (xterm, mintty).
	Fix actual mouse reporting for large coordinates.
2012-04-25 07:25:00 +00:00
Corinna Vinschen f1ce77295d * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 15. 2012-04-24 16:05:20 +00:00
Corinna Vinschen d581bbfa8e * fhandler_console.cc (ALT_PRESSED): Define earlier, never undefine.
(CTRL_PRESSED): Ditto.
	(fhandler_console::read): Simplify expressions testing for pressed ALT
	or CTRL modifier keys.
	(get_nonascii_key): Ditto.
2012-04-24 14:39:22 +00:00
Corinna Vinschen c9df1b2729 * fhandler.h (class dev_console): Add members ext_mouse_mode6 and
ext_mouse_mode15.
	* fhandler_console.cc (fhandler_console::read): Implement extended
	mouse modes 1015 (urxvt, mintty, xterm) and 1006 (xterm).  Recognize,
	but don't implement extended mouse mode 1005 (xterm, mintty).
	Support mouse coordinates greater than 222 (each axis).  Fix formatting.
	(fhandler_console::char_command): Initialize enhanced mouse reporting
	modes.
2012-04-24 14:29:37 +00:00
Christopher Faylor 8b4bd08220 * dtable.cc (fh_alloc): Only disallow opening of nonexistent on-disk device.
* path.cc (path_conv::check): Remove PATH_KEPT_HANDLE setting.
* path.h (path_types): Remove PATH_KEPT_HANDLE.
(path_conv::kept_handle): Delete now-unneeded function.
2012-04-21 19:52:11 +00:00
Christopher Faylor 080f275bae * dtable.cc (fh_alloc): Keep fh which was flagged as error if it is for an
on-disk device and we were stating it.
* path.cc (path_conv::check): Set PATH_KEPT_HANDLE.
* path.h (path_types): Add PATH_KEPT_HANDLE.
(path_conv::kept_handle): Implement.
2012-04-19 17:21:32 +00:00
Christopher Faylor 55dcba98db * fhandler.h (fhandler_base::nohandle): Revert to standard implementation.
* dtable.cc (dtable::fixup_after_exec): Specifically reject releasing
nohandle() type fhandlers rather than relying on contents of io_handle.
(dtable::fixup_after_fork): Ditto.
* fhandler_termios.cc: Add includes necessary for definitions of have_execed
and have_execed_cygwin.
(fhandler_termios::sigflush): Don't flush console input when we've started a
non-Cygwin process.
2012-04-18 05:57:38 +00:00
Christopher Faylor c1d26a99cd reformat 2012-04-15 17:56:50 +00:00
Christopher Faylor aba77cbe8f wincap.h: Rename assitant to assistant throughout. wincap.cc: Ditto.
* devices.in (exists_console): Use fhandler_console::exists () rather than raw
test.
* devices.cc: Regenerate.
* fhandler.h (fhandler_console::exists): Define new function.
* fhandler_console.cc (fhandler_console::need_invisible): Use
fhandler_console::exists () rather than raw test.
* spawn.cc: Rename assitant to assistant throughout.
(child_info_spawn::worker): Simplify test for when to start a non-Cygwin
process in its own process group.  Just do it whenever we start a non-Cygwin
process.
2012-04-15 17:51:22 +00:00
Christopher Faylor 0a3819e655 clarify latest entry 2012-04-13 05:05:42 +00:00
Christopher Faylor 3bfa9d984b * devices.in (exists_console): Allow /dev/con{sole,in,out} to be referenced
they exist.
* devices.cc: Regenerate.
* fhandler_console.cc (fhandler_console::set_unit): Ditto.
2012-04-13 02:30:51 +00:00
Corinna Vinschen e62d782aec * syscalls.cc (fhandler_base::stat_fixup): Fix inode numbers of
non-device files in virtual fileysystems.
2012-04-11 08:49:52 +00:00
Christopher Faylor e5b7e4d1c7 * dtable.cc (cygwin_attach_handle_to_fd): Defend against NULL return from
build_fh_*.
(dtable::init_std_file_from_handle): Ditto.
* mmap.cc (mmap_record::alloc_fh): Ditto.
* path.cc (path_conv::check): Ditto.
2012-04-07 17:32:44 +00:00
Christopher Faylor 00ceaad134 * fhandler.h (fhandler_base::nohandle): Implement "by hand" rather than through
macro.  Set io_handle to INVALID_HANDLE_VALUE when setting flag to true.
2012-04-06 19:40:58 +00:00
Christopher Faylor 25fdb1ded1 * path.c (path_conv::check): Avoid directly referencing fields of the dev
structure when it can be easily avoided.
2012-04-06 04:40:49 +00:00
Christopher Faylor 7217f94752 Fix a couple of typos. 2012-04-06 04:36:22 +00:00
Corinna Vinschen d422f9e30f * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 14. 2012-04-05 15:26:27 +00:00
Corinna Vinschen b475fe5497 * passwd.cc (pwdgrp::read_passwd): Fix pretty_ls entry tyo contain
the required number of colons.
2012-04-05 10:16:09 +00:00
Christopher Faylor 7b03b0d8ce * fhandler.h (fhandler_pty_common::bytes_available): Declare new function.
(fhandler_pty_master::flush_to_slave): Ditto.
* fhandler_tty.cc (bytes_available): Define new function.
(fhandler_pty_common::bytes_available): Ditto.
(handler_pty_master::flush_to_slave): Ditto.
(fhandler_pty_master::process_slave_output): Call flush_to_slave () here.  Use
bytes_available () rather than PeekNamedPipe.  Cleanup sloppy logic.
(fhandler_pty_slave::read): Use bytes_available () rather than PeekNamedPipe.
(fhandler_pty_slave::ioctl): Ditto.
(fhandler_pty_master::ioctl): Ditto.
(fhandler_pty_master::cleanup): Remove ancient #if 0.
* select.cc (peek_pipe): Call flush_to_slave whenever we're checking for a pty
master.
2012-04-05 02:54:51 +00:00
Corinna Vinschen ffcd2c3f89 * fhandler_nodevice.cc (fhandler_nodevice::open): Convert EROFS to
ENOENT if non-existent file got opened for reading only.  Explain why.
	* path.cc (path_conv::check): Stick to ENOENT if file has been opened
	for informational purposes only.  Add to comment.
2012-04-04 12:45:24 +00:00
Corinna Vinschen ce508e512a * path.cc (path_conv::check): Convert device type to FH_FS for
non-existant files on /dev, unless /dev itself doesn't exist on disk.
	Add comment to explain why.
2012-04-04 12:06:21 +00:00
Corinna Vinschen 9e1fe26d12 * hookapi.cc (rvadelta): Compute max_size using SizeOfRawData rather
than VirtualSize.
2012-04-04 11:09:44 +00:00
Corinna Vinschen 7c1d11f7e8 * passwd.cc (_getpass_close_fd): New static pthread cleanup handler.
(getpass): Rework to use /dev/tty in the first place.  Install
	_getpass_close_fd as pthread cleanup handler.  Flush prompt explicitely.
	Lock input and switch off signal input handling when reading password.
2012-04-04 09:57:17 +00:00
Corinna Vinschen fba41a7c3d * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 13. 2012-04-03 14:54:17 +00:00
Corinna Vinschen f777ddfbe3 * syscalls.cc (fhandler_base::stat_fixup): Replace string comparison
with new device::is_dev_resident() call.
2012-04-03 07:28:48 +00:00
Christopher Faylor 17a61045ff * devices.h (lives_in_dev): New field.
(dev_on_fs): Set bit size.
(is_dev_resident): Define new method.
* devices.in: Use different method for labelling requested name for dev
storage: prefix it with a ='.  Use an actual ':' to denote an internal device.
(exists_console): Avoid repeated test.
(exists_ntdev_silent): Rename from the less-descriptive exists_ntdevs.
(dev_dev_storage): Delete unneeded define.
* gendevices: Add a flag to each line denoting whether the device lives in /dev
space.
(generate): Handle special ":" case here for internal devices.  Parse
=something_dev as requiring a storage location.  Tack the rest of the line back
onto the reformulated "$rest".
* devices.cc: Regenerate.
2012-04-02 20:41:46 +00:00
Corinna Vinschen eb7729eb36 * devices.h (device::get_device): New method.
* fhandler_dev.cc (fhandler_dev::readdir): Set st_ino to device number.
	* syscalls.cc (fhandler_base::stat_fixup): Ditto.  Fix link count for
	CD-ROM devices.  Fix typo in comment.
2012-04-02 19:25:58 +00:00
Corinna Vinschen 467e17b9af * fhandler.h (fhandler_base::stat_fixup): Rename from
fhandler_base::set_ino_and_dev.
	* syscalls.cc (fhandler_base::stat_fixup): Ditto. Accommodate name
	change throughout.  Fixup link count of console devices.
2012-04-02 16:19:29 +00:00
Corinna Vinschen f7c8c4540a * devices.h (FH_CYGDRIVE): Define as DEV_VIRTFS_MAJOR class device.
(DEV_CYGDRIVE_MAJOR): Remove.
	(iscygdrive_dev): Define.
	* dtable.cc (fh_alloc): Accommodate above change.
	* path.cc (path_conv::check): Use iscygdrive_dev to check for cygdrive.
	* syscalls.cc (fhandler_base::set_ino_and_dev): Drop check for
	DEV_CYGDRIVE_MAJOR from conditional.
2012-04-02 15:56:43 +00:00
Corinna Vinschen 1f312200d3 * devices.h (FH_DEV): Define as DEV_VIRTFS_MAJOR class device.
(DEV_DEV_MAJOR): Remove.
	* dtable.cc (fh_alloc): Accommodate above change.
	* syscalls.cc (set_ino_and_dev): Drop check for DEV_DEV_MAJOR from
	conditional.
2012-04-02 11:45:56 +00:00
Corinna Vinschen 949cc8b640 * fhandler.h (fhandler_base::set_ino_and_dev): Declare.
* syscalls.cc (fhandler_base::set_ino_and_dev): New method to set
	st_ino, st_dev, and st_rdev for devices in a single spot.
	(fstat64): Call fhandler_base::set_ino_and_dev instead of setting
	st_ino, st_dev, and st_rdev here.
	(stat_worker): Ditto.
2012-04-02 11:18:45 +00:00
Corinna Vinschen da8274643c * fhandler.h (fhandler_dev::open): Declare.
(fhandler_dev::close): Declare.
	(fhandler_dev::fstat): Declare.
	(fhandler_dev::fstatvfs): Declare.
	(fhandler_cygdrive::fstatvfs): Declare.
	* fhandler_dev.cc (fhandler_dev::open): New method.
	(fhandler_dev::close): Ditto.
	(fhandler_dev::fstat): Ditto.
	(fhandler_dev::fstatvfs): Ditto.
	* fhandler_disk_file.cc (fhandler_base::fstat_helper): Don't fill
	st_rdev.
	(fhandler_cygdrive::fstatvfs): New method.
	* path.h (path_conv::fs_got_fs): New method.
	* mount.h (fs_info::got_fs): Change type to bool, make public.
2012-04-02 11:08:07 +00:00