Commit Graph

5904 Commits

Author SHA1 Message Date
Corinna Vinschen c416f16d44 * Makefile.in, configure.in, mkvers.sh: Revert accidental checkin from
2012-07-06.
2012-07-09 09:00:56 +00:00
Christopher Faylor a9cd97c8e2 * Makefile.in: Change mingw_lib (temporarily?) back to w32api_lib. 2012-07-08 00:51:45 +00:00
Corinna Vinschen 3eedbf8611 * winlean.h (__STRALIGN_H_): Drop definition. 2012-07-06 14:44:13 +00:00
Corinna Vinschen 44fb3af98a * fhandler_procnet.cc: Fix copyright.
* syslog.cc: Ditto.
	* libc/minires-os-if.c: Ditto.
	* libc/minires.h: Ditto.
2012-07-06 13:56:37 +00:00
Corinna Vinschen db80f635c1 In terms of network related functionality, rely on Winsock definitions
as much as possible:
	* dtable.cc: Drop including sys/socket.h.
	* fhandler_procnet.cc: Change includes accordingly.
	* fhandler_socket.cc: Ditto.
	(fhandler_socket::listen): Avoid gcc error message initializing sin6.
	(LPFN_WSARECVMSG): Only define when building against w32api headers.
	* net.cc: Change includes accordingly.  Define USE_SYS_TYPES_FD_SET
	and __WSA_ERR_MACROS_DEFINED.  Define _INC_NETIOAPI temporarily and
	explain why.
	(struct _IP_ADAPTER_UNICAST_ADDRESS_LH): Only define when building
	against w32api headers.
	(struct _IP_ADAPTER_ADDRESSES_LH): Ditto.
	(SIO_GET_INTERFACE_LIST): Ditto.
	(ws_freeaddrinfo): Rename from freeaddrinfo so as not to collide with
	Winsock declaration.  Change througout.
	(ws_getaddrinfo): Ditto.
	(ws_getnameinfo): Ditto.
	* select.cc: Include netdb.h after defining USE_SYS_TYPES_FD_SET.
	* syslog.cc: Drop including netinet/in.h.  Define USE_SYS_TYPES_FD_SET
	and include ws2tcpip.h.
	* include/netdb.h (struct addrinfo): Don't define when building Cygwin.
	* include/cygwin/if.h: Don't declare if_xxx functions when building
	Cygwin.
	* include/cygwin/in.h: Disable most definitions when building Cygwin.
	* include/cygwin/socket.h: Disable sockaddr and sockaddr_storage
	definitions when building Cygwin.  Same for MCAST_INCLUDE/MCAST_EXCLUDE.
	* libc/inet_addr.c: Don't define __INSIDE_CYGWIN__ nor
	__INSIDE_CYGWIN_NET__.
	* libc/inet_network.c: Ditto.
	* libc/minires.h: Drop redundant inclusion of netdb.h.  Define
	__INSIDE_CYGWIN_NET__ only before including netdb.h and resolver
	headers.
2012-07-06 13:52:19 +00:00
Corinna Vinschen f3a43e7ef0 * winbase.h: Throughout use LONG rather than long type to prepare for
64 bit.
	(InterlockedCompareExchangePointer): Define.
2012-07-06 13:51:26 +00:00
Corinna Vinschen 6f94526c1c * fhandler_registry.cc (RegOpenUserClassesRoot): Only define when
building against w32api headers.
	(RegOpenCurrentUser): Ditto.
	* fhandler_tty.cc (GetNamedPipeClientProcessId): Ditto.
	* ntdll.h (enum _PROCESSINFOCLASS): Add ProcessImageFileName.
	(RtlInitAnsiString): Declare.
	(RtlUnicodeStringToAnsiSize): Declare.
	* sched.cc (GetForegroundWindow): Ditto.
	* sec_helper.cc (SECURITY_NT_NON_UNIQUE): Define as
	SECURITY_NT_NON_UNIQUE_RID when building against w32api headers.
	(cygsid::get_sid): Use SECURITY_NT_NON_UNIQUE rather than
	SECURITY_NT_NON_UNIQUE_RID.
	(__sec_user): Use PISECURITY_DESCRIPTOR rather than PSECURITY_DESCRIPTOR
	to allow valid pointer arithmetic.
	(_recycler_sd): Ditto.
	(_everyone_sd): Ditto.
2012-07-06 13:49:53 +00:00
Corinna Vinschen a02924944e * winsup.h (_WIN32_WINNT): Define. Explain why. 2012-07-06 12:13:50 +00:00
Corinna Vinschen 862de2d0ae * libc/rcmd.cc: Don't undef __INSIDE_CYGWIN_NET__. 2012-07-06 12:05:19 +00:00
Corinna Vinschen da36286e64 * cygwin.sc (.rdata): Include all sections starting with .rdata.
(.debug_pubtypes): Make sure section is loaded at the end like all other
	debug sections.
2012-07-06 10:44:38 +00:00
Christopher Faylor ea51d3d425 * dcrt0.cc (build_argv): Guard against NULL pointer dereference found by Clang. 2012-07-04 17:30:55 +00:00
Christopher Faylor 85b2b14e7a * exceptions.cc (setup_handler): Remove unneeded assignment found by Clang. 2012-07-04 06:06:54 +00:00
Christopher Faylor 226133e80c * hookapi.cc (find_first_notloaded_dll): Remove unused assignment of
importRVASize found by Clang.
2012-07-04 06:04:16 +00:00
Christopher Faylor 0bdf68577d * fhandler_tty.cc (fhandler_pty_slave::read): Remove duplicate assignment to
bytes_in_pipe found by Clang.
2012-07-04 06:01:16 +00:00
Christopher Faylor 51e4c3d44c * exceptions.cc (exception::handle): Use error_code in klog, as intended.
Found by Clang.
2012-07-03 05:31:11 +00:00
Corinna Vinschen 8fd8f9e72b * fhandler.h (class fhandler_dev_clipboard): Remove member eof.
* fhandler_clipboard.cc: Throughout remove handling of eof member.
	(fhandler_dev_clipboard::write): Handle EOF condition immediately,
	rather than pushing it erroneously to the next read call.  Rearrange
	code.  Fix bug in CF_UNICODETEXT case which potentially dropped single
	bytes at the end of the buffer.  Add comment.
	* strfuncs.cc (sys_cp_wcstombs): Allow returning non-NUL-terminated
	buffer if dst != NULL and len == (size_t) -1.  Extend leading comment
	to explain what's returned in more detail.
2012-07-02 20:17:27 +00:00
Christopher Faylor ceec584ad3 * fhandler_virtual.cc (fhandler_virtual::opendir): Eliminate duplicate
assignment found by Clang.
2012-07-02 20:01:19 +00:00
Christopher Faylor e82360f659 * fhandler_registry.cc (fhandler_registry::open): Handle missing EROFS error
condition pointed to by Clang.
2012-07-02 20:00:22 +00:00
Christopher Faylor e9d7f5b3a9 * pinfo.cc (_pinfo::commune_request): Eliminate unneeded assignment found by
Clang.
2012-07-02 19:55:51 +00:00
Christopher Faylor fb348d22af * external.cc (fillout_pinfo): Return NULL rather than 0.
(exit_process): Guard against NULL pointer dereference found by Clang.
2012-07-02 19:48:33 +00:00
Christopher Faylor e14a5a7efa * mount.cc (mount_info::conv_to_win32_path): Eliminate unneeded assignment
found by CLANG.
* path.cc (symlink_info::check): Remove unneeded/unused variable found by
CLANG.
2012-07-02 19:42:34 +00:00
Christopher Faylor fade1f2e21 * path.cc (symlink_info::check): Remove unneeded/unused variable. 2012-07-02 19:38:41 +00:00
Corinna Vinschen 26e603454f * dll_init.cc (dll_list::alloc): Take long UNC paths into account. 2012-07-02 14:14:01 +00:00
Christopher Faylor 1809b65e23 * Makefile.in: Add some more optimization flags for cygwait, malloc and path. Explain
why -fomit-frame-pointer doesn't work right for passwd.o and path.o.  Add
-static to link command line for cygwin0.dll.
* fhandler_disk_file.cc (fhandler_disk_file::facl): Reorganize slightly to
silence compiler warning when compiling with -fstack-check.
* net.cc (inet_ntop6): Initialize structure members to silence compiler warning
when compiling with -fstack-check.
* pseudo-reloc.cc (_pei386_runtime_relocator): Make this a C function.  Detect
NULL u.
* winsup.h (_pei386_runtime_relocator): Declare this as extern "C".
* lib/_cygwin_crt0_common.cc (_pei386_runtime_relocator): Call with NULL
argument.
* signal.cc (sigaction_worker): Eliminate last argument.  Let callers report
their own strace info.  Regparmize.
(sigaction): Reflect sigaction_worker changes.
(siginterrupt): Ditto.
* exceptions.cc: Update copyright.
2012-07-02 02:24:25 +00:00
Christopher Faylor c4441d46b6 * path.cc: Perform some whitespace fixups throughout. 2012-07-02 00:40:06 +00:00
Corinna Vinschen ca4d966d1b * kernel32.cc (_KERNEL32_): Define. Explain why.
(CreateFileMappingW): Drop undocumented flProtect flags.
2012-06-28 20:06:23 +00:00
Corinna Vinschen ca7f6a04b3 * fhandler_serial.cc: Fix includes for IOCTL codes to support Mingw64.
* fhandler_tape.cc: Ditto.
	* flock.cc (allow_others_to_sync): Use PISECURITY_DESCRIPTOR since
	PSECURITY_DESCRIPTOR is supposed to be the opaque type.
	* ntdll.h: Remove CreateDisposition flags again, now that they are
	defined in Mingw64's ntdef.h.  Ditto for Create/Open flags.
2012-06-28 19:25:22 +00:00
Corinna Vinschen 06e429fd6d * exceptions.cc (RtlUnwind): Align declaration with MSDN.
* ntdll.h: Define CreateDisposition Flags.  Add comments.
	* winlean.h: Define FILE_SHARE_VALID_FLAGS if using Mingw64 headers.
2012-06-28 14:06:06 +00:00
Christopher Faylor b052bf2671 * cygwait.h (cancelable_wait): Make extern to avoid always including.
* select.cc (allocfd_set): Try to make a little more efficient.
(cygwin_select): Break into two functions to avoid what seems to be a strange
compiler problem with alloca and sel constructor.
(select): New function.  Always honor return from call_signal_handler.
(select_stuff::wait): Always honor return from call_signal_handler.
* select.h (select_stuff::select_stuff): Use NULL to initialize pointers rather
than 0.
2012-06-27 21:42:11 +00:00
Corinna Vinschen c60437258a * exceptions.cc (exception::handle): Cast exception code to NTSTATUS
for comparison.
	* ntdll.h: Drop defining NT status codes in favor of including
	ntstatus.h.
2012-06-27 16:24:54 +00:00
Corinna Vinschen 165f575341 * miscfuncs.cc (WritePipeOverlapped): Define second parameter LPCVOID,
rather than PCVOID.
	* miscfuncs.h (WritePipeOverlapped): Ditto.
2012-06-27 13:35:48 +00:00
Corinna Vinschen 25f3ea84f8 * advapi32.cc (_ADVAPI32_): Define. Explain why.
(ImpersonateNamedPipeClient): Add missing WINAPI.
	* ntdll.h (STATUS_INVALID_PARAMETER): Only define if it isn't already.
	(STATUS_DLL_NOT_FOUND): Ditto.
	(STATUS_ENTRYPOINT_NOT_FOUND): Ditto.
	(enum _EVENT_TYPE): Guard against redefinition since it's already
	defined in Mingw64's ntdef.h.
	(enum _TIMER_TYPE): Ditto.
	(enum _SECTION_INHERIT): Define if using Mingw64 headers since it's
	missing in Mingw64's ntdef.h.
	* winlean.h (__STRALIGN_H_): Define before including windows.h.
2012-06-27 13:19:11 +00:00
Corinna Vinschen a90b8a20ed * winsup.h (GetLastError): Drop redundant definition. 2012-06-26 16:36:00 +00:00
Christopher Faylor 6ec05d23b3 * cygwait.cc (cancelable_wait): Make sure that timer is cancelled before
cancelling thread.
2012-06-25 16:28:50 +00:00
Christopher Faylor d6953d3f7d * cygwait.h (cancelable_wait): Need to force time to negative to indicate
relative time.
2012-06-25 05:00:39 +00:00
Corinna Vinschen 970790c681 * path.cc (realpath): Fix comment. 2012-06-22 09:51:29 +00:00
Corinna Vinschen 797ff24dfb * path.cc (realpath): Call mount_info::conv_to_posix_path rather than
mount_info::cygdrive_posix_path to convert DOS paths to POSIX paths.
	Add comment to explain why that's necessary at all.
2012-06-21 09:33:19 +00:00
Christopher Faylor 978441cc0e * cygwait.h (LARGE_NULL): Define.
(cancelable_wait): Define variant which accepts DWORD time argument.
(cygwait): Use cancelable_wait with DWORD argument.
(cygwait): Use cancelable_wait with DWORD argument and cw_sig_eintr for
timeout-only case.
* exceptions.cc (handle_sigsuspend): Use LARGE_NULL as second argument to
distinguish between cancelable_wait variants.
* thread.cc (pthread_mutex::lock): Ditto.
(pthread::join): Ditto.
(semaphore::_timedwait): Ditto.
* thread.h (fast_mutex::lock): Ditto.
* wait.cc (wait4): Ditto.
2012-06-19 00:52:59 +00:00
Christopher Faylor af5cd14583 * cygwait.cc (cancelable_wait): Mimic old cygwait behavior more closely wrt
handling of call_signal_handler.
* cygwait.h (WAIT_CANCELED): Move here and redefine.
(WAIT_SIGNALED): Ditto.
* thread.h (WAIT_CANCELED): Delete.
(WAIT_SIGNALED): Ditto.
2012-06-19 00:31:15 +00:00
Corinna Vinschen 099817c3db * cygheap.cc (init_cygheap::init_installation_root): Rearrange code
creating valid native NT installation_root path.  Only strip last
	backslash from path if the result is a valid NT path.  Explain why.
2012-06-18 20:17:15 +00:00
Christopher Faylor 4ae6378382 Add '#include "cygwait.h"' throughout, where appropriate.
* DevNotes: Add entry cgf-000012.
* Makefile.in (DLL_OFILES): Add cygwait.o.
* sigproc.h: Remove cygwait definitions.
* cygwait.h: New file.  Define/declare Cygwin waitfor functions.
* cygwait.cc: Ditto.
* exceptions.cc: Include cygwait.h.
(handle_sigsuspend): Accommodate change in cancelable_wait arguments.
(sigpacket::process): Display thread tls in debugging output.
* fhandler.cc (fhandler_base_overlapped::wait_overlapped): Use symbolic names
for signal and cancel return.
* fhandler_console.cc (fhandler_console::read): Ditto.
(fhandler_dev_dsp::Audio_out::waitforspace): Ditto.
fhandler_dev_dsp::Audio_in::waitfordata): Ditto.
* fhandler_fifo.cc (fhandler_fifo::wait): Ditto.
* fhandler_serial.cc (fhandler_serial::raw_read): Ditto.
* fhandler_tty.cc (fhandler_pty_slave::read): Ditto.
* select.cc (cygwin_select): Ditto.
* wait.cc (wait4): Ditto.
* thread.cc (cancelable_wait): Move definition to cygwait.h.
(pthread_cond::wait): Accommodate change in cancelable_wait arguments.
(pthread_mutex::lock): Ditto.
(pthread_spinlock::lock): Ditto.
(pthread::join): Ditto.
(pthread::thread_init_wrapper): Display tls in debugging output.
(semaphore::_timedwait): Ditto.
* thread.h (cw_sig_wait): Move to cygwait.h.
(cw_cancel_action): Delete.
(cancelable_wait): Move declaration to cygwait.h.
2012-06-17 20:50:24 +00:00
Yaakov Selkowitz 933ee0ecbf Fix last ChangeLog entry. 2012-06-12 18:34:38 +00:00
Yaakov Selkowitz 3e5a48af5e * regex/regcomp.c (p_ere): Allow vertical-line following
left-parenthesis in ERE, as in glibc.
2012-06-11 22:15:27 +00:00
Yaakov Selkowitz 53943a2e87 * include/sys/elf_common.h (R_386_16): Define.
(R_386_PC16): Define.
	(R_386_8): Define.
	(R_386_PC8): Define.
2012-06-10 18:28:16 +00:00
Christopher Faylor abf1b60039 * select.cc (cygwin_select): Remove select_timeout test.
(select_stuff::wait): Return select_set_zero on timeout.
(thread_socket): Report timeout when debugging.
2012-06-10 01:57:53 +00:00
Yaakov Selkowitz f513e3a206 * include/elf.h: Update from FreeBSD.
* include/machine/elf.h: New header, from FreeBSD.
	* include/sys/elf.h: Ditto.
	* include/sys/elf32.h: Update from FreeBSD.
	* include/sys/elf64.h: Ditto.
	* include/sys/elf_common.h: Ditto.
	(R_IA64_*): Define Linux-style names as aliases to R_IA_64_*.
	(R_SH_*): Define, based on sh-4 psABI.
	(R_390_*): Define, based on s390x psABI.
	* include/sys/elf_generic.h: Ditto.
2012-06-06 04:45:48 +00:00
Corinna Vinschen cd69beda67 * fhandler_disk_file.cc (fhandler_disk_file::link ): Translate
STATUS_NOT_SUPPORTED to EPERM as well.
2012-06-04 08:49:13 +00:00
Christopher Faylor b9c61a8d7b * dtable.cc (dtable::dup3): Only return with lock set when O_EXCL flag is
passed in.
* syscalls.cc (dup_finish): Pass O_EXCL in flags to dtable::dup3.
2012-06-04 01:26:05 +00:00
Christopher Faylor 3143cb7c00 * DevNotes: Add entry cgf-000011.
* fhandler.h (fhandler_base::refcnt): Delete.
(fhandler_base::inc_refcnt): New function.
(fhandler_base::dec_refcnt): New function.
* cygheap.h (cygheap_fdnew::~cygheap_fdnew): Accommodate split of refcnt to
inc_refcnt/dec_refcnt.
(cygheap_fdget::cygheap_fdget): Ditto.
(cygheap_fdget::~cygheap_fdget::cygheap_fdget): Ditto.
* dtable.cc (dtable::release): Ditto.
(cygwin_attach_handle_to_fd): Ditto.
(dtable::init_std_file_from_handle): Ditto.
(dtable::dup3): On success, return with fdtab locked.
* dtable.h (dtable): Add dup_finish as a friend.
* syscalls.cc (dup_finish): Define new function.  Increment refcnt while fdtab
is locked.
(dup2): Use common dup_finish() to perform dup operation.
(dup3): Ditto.
2012-06-03 18:02:45 +00:00
Corinna Vinschen 115d74b99e * globals.cc (ro_u_refs): New R/O unicode string.
* mount.cc (fs_info::update): Recognize ReFS.
	* mount.h (enum fs_info_type): Add refs.
	(class fs_info): Add refs flag and accessor methods.
	* ntdll.h (RtlAddAccessAllowedAceEx): Declare.
	(RtlAddAccessDeniedAceEx): Declare.
	* path.h (path_conv::fs_is_refs): Define.
	* sec_helper.cc (_recycler_sd): New function to create security
	descriptors suitable for the recycler bin starting with Vista.
	* security.cc (add_access_allowed_ace): Use RtlAddAccessAllowedAceEx
	and drop code to set AceFlags explicitely.
	(add_access_denied_ace): Use RtlAddAccessDeniedAceEx and drop code to
	set AceFlags explicitely.
	* security.h (_recycler_sd): Declare.
	(recycler_sd): Define.
	* syscalls.cc (desktop_ini): Change formatting.
	(desktop_ini_ext): Define third line of recycler desktop.ini file
	since Vista,
	(try_to_bin): Handle ReFS just like NTFS.  Write Vista and later
	Recycler in all uppercase, just like shell32 does when recreating it.
	Fix comments to include ReFS.  Don't implicitely reuse object
	attributes from earlier NtOpenFile call, rather recreate it for safety.
	Use recycler_sd call when creating security descriptor for Recycler
	dirs and files on Vista and later.  Write third line of desktop.ini
	when on Vista and later.
2012-06-03 16:46:53 +00:00