Commit Graph

4837 Commits

Author SHA1 Message Date
Christopher Faylor c6a6b5a3ac * dlfcn.cc (dlopen): Make sure exception handler is really loaded after dynamic
load.
2010-02-24 08:03:44 +00:00
Christopher Faylor fd4a56afe8 * cygtls.cc (_cygtls::init_exception_handler): Force installation of our
exception handler to always be at the beginning.
2010-02-24 00:03:42 +00:00
Christopher Faylor 7414c24a77 * thread.cc (pthread_mutex::unlock): Don't attempt to unlock if there is an
error.
2010-02-23 07:12:38 +00:00
Christopher Faylor 478ea460eb * include/sys/strace.h: Define _STRACE_SPECIAL.
(strace_printf_wrap): Fix NOSTRACE definitions.
(strace_printf_wrap1): Fix NOSTRACE definitions.
(special_printf): Define.
* thread.cc: Perform minor syntax fix in a comment.  Rename
"is_good_initialzer*" to "is_initializer*" throughout.  Use pthread_printf
rather than debug_printf throughout.  Add extra pthread_printf debugging
throughout.
(pthread_mutex::_new_mutex): New constant value.
(pthread_mutex::_unlocked_mutex): Ditto.
(pthread_mutex::_destroyed_mutex): Ditto.
(pthread_mutex::no_owner): Define new function.
(pthread_mutex::can_be_unlocked): Detect no_owner situation.  Handle
PTHREAD_MUTEX_NORMAL as a special case.
(pthread::create_cancel_event): Use C++ boolean values.
(pthread::precreate): Use method to set mutex type.
(pthread_cond::pthread_cond): Ditto.
(pthread_rwlock::pthread_rwlock): Ditto.
(pthread_mutex::pthread_mutex): Set owner to _new_mutex initially.
(pthread_mutex::~pthread_mutex): Reset various elements to make it clearer if
they are incorrectly reused.
(pthread_mutex::lock): Add clarifying comment.
(pthread_mutex::unlock): Attempt to handle various mutex types correctly.  In
particular, reinstate ability to have one thread unlock another thread's mutex
if type == PTHREAD_MUTEX_NORMAL.
(semaphore::_fixup_after_fork): Avoid redundancy.
(pthread_mutex::_fixup_after_fork): Ditto.  Fix debugging statement.
(__pthread_cond_dowait): Accommodate changes to remove previously inexplicable
use can_be_unblocked() as a static function.
* thread.h: Rename "is_good_initialzer*" to "is_initializer*" throughout.
(pthread_mutex): Reorganize.  Make many things private.
(pthread_mutex::no_owner): Define new method.
(pthread_mutex::_new_mutex): Define new constant.
(pthread_mutex::_unlocked_mutex): Ditto.
(pthread_mutex::_destroyed_mutex): Ditto.
2010-02-22 20:36:04 +00:00
Corinna Vinschen f2ecf0ee5b * lc_era.h: Redefine lc_era_t to keep
default date and time formats as well to workaround YA Windows
	shortcoming.  Refresh with latest data.
	* lc_msg.h: Refresh with latest data.
	* nlsfuncs.cc (__eval_datetimefmt): Revert latest change.
	(__set_lc_time_from_win): Rename res to era.  Prefer default date and
	time formats from era array if available.
	(__set_lc_messages_from_win): Rename res to msg.
2010-02-22 11:01:46 +00:00
Corinna Vinschen 5d76584680 * lc_era.h (lc_era): Fix "ja_JP" era_t_fmt entry to use traditional
format.
	* nlsfuncs.cc (dt_flags): Remove DT_ERACAL since crippled era data
	in Windows makes it useless.
	(__eval_datetimefmt): Check if locale's default calender has
	non-gregorian start year.  Use era year also in default date entries,
	if so.
2010-02-20 22:10:26 +00:00
Corinna Vinschen 53a918f3d6 * path.cc (warn_msdos): Enforce extended hex printing of multibyte
pathnames.
2010-02-20 09:17:07 +00:00
Christopher Faylor ff3e6bcbec utils/ChangeLog:
* strace.cc (mnemonic_table): Add pthread mask option.
(usage): Document strace pthread mask option.
* utils.sgml: Ditto.

cygwin/ChangeLog:
* include/sys/strace.h: Remove old code.  Add support for ptrace
tracing.
2010-02-19 17:55:27 +00:00
Corinna Vinschen 6c36e83bab * lc_era.h: New file.
* nlsfuncs.cc: Include lc_era.h.
	(locale_cmp): convert arguments to char** to be usable for both types,
	lc_msg_t and lc_era_t.
	(__set_lc_time_from_win): Handle era-related data
2010-02-19 17:30:19 +00:00
Corinna Vinschen 1929fc8ece * fhandler_disk_file.cc (fhandler_disk_file::opendir): Try to open
directory with stat()-friendly access mask first.  Explain why.
2010-02-19 13:28:49 +00:00
Corinna Vinschen eb67604071 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Set st_rdev
to same value as st_dev.  Avoid useless debug output in executable
	check.  Add filename to debug output.
	(fhandler_disk_file::facl): Simplify code calling fstat methods to
	just call fstat to avoid errors with the cygdrive directory.
2010-02-19 12:37:37 +00:00
Corinna Vinschen 97c8d005d9 * nlsfuncs.cc (eval_datetimefmt): Rename force to flags.
(enum dt_flags): Define.
	(__eval_datetimefmt): Change force to flags and change type to
	dt_flags.  Accommodate throughout.
	(__set_lc_time_from_win): Accommodate above change.  Set era-related
	values to empty strings for now.
2010-02-18 18:07:14 +00:00
Christopher Faylor 90f5de33d5 * fhandler.cc (fhandler_base::setup_overlapped): Revert to starting with handle
in signalled state as it seems to fix some hangs.
2010-02-18 15:07:38 +00:00
Corinna Vinschen 66f2d8f13e * path.cc (path_conv::check): Treat native DOS paths as "noacl". 2010-02-15 13:29:02 +00:00
Corinna Vinschen 93579594b7 * mount.cc (mount_info::conv_to_win32_path): Set UNC path flags to
cygdrive prefix path flags.
2010-02-15 12:42:31 +00:00
Christopher Faylor 8103e40743 * fhandler.cc (fhandler_base::setup_overlapped): Don't set signalled state to
true initially.
(fhandler_base::has_ongoing_io): Delete ill-advised function.
(fhandler_base::read_overlapped): Rely on caller having checked nonblocking
state.  Don't attempt to (incorrectly) check it here.
(fhandler_base::write_overlapped): Remove call to has_ongoing_io.
* select.cc (peek_pipe): Ditto.
* fhandler.h (fhandler_base::has_ongoing_io): Delete declaration.
2010-02-15 01:45:05 +00:00
Christopher Faylor d67a6ce4a8 * regex/regcomp.c (xwcrtomb): Fix one explicable and one inexcplicable C
warning.
2010-02-14 21:28:44 +00:00
Corinna Vinschen 15a9e17656 * regex/regcomp.c (xwcrtomb): Don't convert Unicode chars outside the
base plane always to UTF-8.  Call wcsnrtombs instead to allow arbitrary
	multibyte charsets.
2010-02-13 12:26:06 +00:00
Corinna Vinschen 6b3f923fe2 * regex/regcomp.c (wgetnext): Use size_t as type for n2 since that's
what's returned by mbrtowc.
	* regex/regexec.c (xmbrtowc): Ditto.
2010-02-12 20:17:22 +00:00
Christopher Faylor 2b1407d372 * pthread.cc (pthread_mutex_init): Explicitly fill out third arg to
pthread_mutex::init.
* thread.cc: Remov some obsolete comments.
(verifyable_object_isvalid): Reflect change to use thread_magic_t for magic
numbers.
(pthread_mutex::pthread_mutex): Set magic number to invalid initially until
we've verified that everything is valid.
(pthread_mutex::unlock): Fix a comment.
(verifyable_object::verifyable_object): Delete here.
(~verifyable_object::~verifyable_object): Ditto.
(pthread_mutex::init): Don't run is_good_initializer for non-static objects.
* thread.h (thread_magic_t): New typedef.
(verifyable_object::verifyable_object): Use thread_magic_t;
(verifyable_object::magic): Ditto.
(pthread_mutex::is_good_initializer_or_bad_object): Remove unneeded variable
names.
(pthread_mutex::can_be_unlocked): Ditto.
(pthread_mutex::init): Ditto.  Remove default for third argument.
2010-02-12 20:07:13 +00:00
Christopher Faylor 97e5d3ffa4 fix typo 2010-02-12 18:38:59 +00:00
Corinna Vinschen 7bd2296c83 * regex/regcomp.c (xwcrtomb): New function to convert wide chars
outside of the base plane to UTF-8.  Call throughout instead of
	wcrtomb.
	(wgetnext): Handle surrogate pairs on UTF-16 systems.
	* regex/regexec.c (xmbrtowc): Ditto.
2010-02-12 17:46:39 +00:00
Corinna Vinschen e122c47112 * sec_auth.cc (get_user_local_groups): Retrieve name of well known
builtin group from system.  Explain why.
	* sec_helper.cc (well_known_builtin_sid): New SID for BUILTIN group.
	* security.h (well_known_builtin_sid): Declare.
2010-02-12 17:40:42 +00:00
Pierre Humblet 848dbc8f98 2010-02-11 Pierre Humblet <Pierre.Humblet@ieee.org>
* registry.c (get_registry_hive_path): Add space in string.
2010-02-12 01:04:52 +00:00
Corinna Vinschen 44caccfca2 * regex/engine.c (step): Drop Cygwin-specific definition.
(NONCHAR): Better cast here to make the test work.  Move comment
	from step here.
	(matcher): Disable skipping initial string in multibyte case.
	* regex/regcomp.c (p_bracket): Don't simplify singleton in the invert
	case.
	(p_b_term): Handle early end of pattern after dash in bracket
	expression.
	(singleton): Don't ignore the wides just because there's already a
	singleton in the single byte chars.  Fix condition for a singleton
	wide accordingly.
	(findmust): Check for LC_CTYPE charset, rather than LC_COLLATE charset.
	* regex2.h (CHIN): Fix condition in the icase & invert case.
	(ISWORD): Fix wrong cast to unsigned char.
2010-02-11 21:19:19 +00:00
Corinna Vinschen 87c0903113 * nlsfuncs.cc (initial_setlocale): Move check whether charset has
changed from here...
	(internal_setlocale): ...to here, to avoid unnecessary work when invoked
	via CW_INT_SETLOCALE.
2010-02-11 10:04:51 +00:00
Corinna Vinschen 4f1c922e06 * nlsfuncs.cc (__set_charset_from_locale): Allow "@euro" modifier only
for locales which use EUR as currency.
2010-02-10 12:29:26 +00:00
Corinna Vinschen ae40237a0a * nlsfuncs.cc (__get_lcid_from_locale): Convert iu_CA to iu-Latn-CA
rather than iu-Cans-CA on Vista and later.
	(__set_charset_from_locale): Set default charset for iu_CA to UTF-8.
2010-02-10 10:44:21 +00:00
Christopher Faylor 3700578ee8 * dcrt0.cc (_dll_crt0): Set _main_tls as early as possible.
* thread.cc (pthread_mutex::can_be_unlocked): Remove check for
MUTEX_OWNER_ANONYMOUS since it is racy and unsafe.
(pthread::init_mainthread): Initialize thread directly from _my_tls.
(pthread::self): Ditto.
(pthread::get_tls_self_pointer): Delete.
(pthread_mutex::pthread_mutex): Use an event rather than a semaphore.
(pthread_mutex::lock): Rename from _<func>.  Derive self directly.
(pthread_mutex::tryunlock): Ditto.
(pthread_mutex::destroy): Ditto.
(pthread_mutex::unlock): Ditto.  Accommodate change from semaphore to event.
(pthread_mutex::_fixup_after_fork): Accommodate change from semaphore to event.
(pthread_mutex::init): Don't attempt to initialize a semaphore unless it is in
an initialized state.  Do this check under mutex_initialization_lock.lock
* thread.h (fast_mutex::init): Use event rather than semaphore.
(fast_mutex::lock): Ditto.
(pthread_mutex::_lock): Delete.
(pthread_mutex::_unlock): Ditto.
(pthread_mutex::_trylock): Ditto.
(pthread_mutex::_destroy): Ditto.
(pthread_mutex::get_pthread_self): Ditto.
(pthread_mutex::get_tls_self_pointer): Ditto.
(pthread_mutex::lock): Un-inline.
(pthread_mutex::unlock): Ditto.
(pthread_mutex::trylock): Ditto.
(pthread_mutex::destroy): Ditto.
2010-02-10 07:25:26 +00:00
Christopher Faylor 161387a725 * cygtls.h (struct _cygtls): Remove unneeded elements.
* thread.cc (pthread::exit): Avoid potential double call to _my_tls.remove.
* tlsoffsets.h: Regenerate.
2010-02-10 03:17:32 +00:00
Corinna Vinschen 3d9e3644ee * nlsfuncs.cc (__set_lc_messages_from_win): Fix typo. 2010-02-09 11:44:03 +00:00
Corinna Vinschen 9008eb4041 * lc_msg.h: New file, fix a problem in locales with modifiers. 2010-02-09 11:38:44 +00:00
Corinna Vinschen 09dfe7e025 * lc_msg.h: New file, generated from running Linux system. 2010-02-09 11:16:38 +00:00
Corinna Vinschen 502a4f52ed * lc_msg.h: New file, autogenerated from CLDR data.
* nlsfuncs.cc: Include lc_msg.h.
	(lc_time_buf): Remove.
	(lc_numeric_buf): Remove.
	(lc_monetary_buf): Remove.
	(lc_mbstowcs): Fix previous fix.
	(__set_lc_time_from_win): Take additional pointer to buffer pointer,
	defined in newlib.
	(__set_lc_numeric_from_win): Ditto.
	(__set_lc_monetary_from_win): Ditto.
	(locale_cmp): New static function.
	(__set_lc_messages_from_win): New function to be called from newlib.
2010-02-09 08:59:49 +00:00
Corinna Vinschen f5a73638cd * external.cc (cygwin_internal): Add CW_INT_SETLOCALE case to
allow to call internal_setlocale().
	* nlsfuncs.cc (internal_setlocale): Make externally available.
	* include/cygwin/version.h: Bump API minor number.
	* include/sys/cygwin.h (cygwin_getinfo_types): Add CW_INT_SETLOCALE.

	* nlsfuncs.cc (lc_mbstowcs): Fix call to f_mbtowc.
	(__set_locale_from_locale_alias): Ignore "@cjknarrow" modifier.
2010-02-08 09:52:40 +00:00
Corinna Vinschen ab6ef08082 * nlsfuncs.cc (__get_lcid_from_locale): Handle "@cyrillic" modifier
for uz_UZ locale here.
	(__set_charset_from_locale): Accommodate above change.
2010-02-07 17:35:59 +00:00
Corinna Vinschen 07d061aeec * nlsfuncs.cc (__set_locale_from_locale_alias): New function to read
locale aliases from /usr/share/locale/locale.alias.
2010-02-07 13:31:08 +00:00
Corinna Vinschen 689109a76f * nlsfuncs.cc (__get_lcid_from_locale): Handle no_NO as nb_NO, rather
than nn_NO.
2010-02-06 21:57:33 +00:00
Corinna Vinschen 28d3c4fa38 * nlsfuncs.cc (has_modifier): MOve up in file to use in
__get_lcid_from_locale as well.
	(__get_lcid_from_locale): Handle no_NO locale as alias for nn_NO.
	Default all sr_XY locales to Cyrillic script.  Change lcid to Latin
	script if "@latin" modifier has been specified.
	(__set_charset_from_locale): Handle Serbian in codepage 1251 case as
	well.  Also check for sr_BA lcid.  Restrict "@euro" modifier to
	locales otherwise defaulting to ISO-8859-1.
2010-02-06 21:40:53 +00:00
Corinna Vinschen b6b236270e * nlsfuncs.cc (__set_charset_from_locale): Set default charset for
"ka_GE" locale to GEORGIAN-PS, for "kk_KZ" to PT154.
2010-02-06 18:30:18 +00:00
Corinna Vinschen 38d9821daf * path.cc (symlink_info::check_nfs_symlink): Reopen file with
FILE_READ_EA access since, surprisingly, you need it to read EAs even
	on NFS.
2010-02-06 15:57:21 +00:00
Corinna Vinschen b96600ef91 * sec_auth.cc (get_full_privileged_inheritable_token): New function
to fetch token with full privileges from logon token in Vista and
	later, and to make token inheritable.  Add lengthy comments to explain
	the function's job.
	(cygwin_logon_user): Drop calling SetHandleInformation.  Enable TCB
	privilege and call get_full_privileged_inheritable_token.
	(lsaauth): Don't fetch linked token and don't make handle inheritable
	here, just call get_full_privileged_inheritable_token instead.
	(lsaprivkeyauth): Ditto.
2010-02-06 13:13:15 +00:00
Corinna Vinschen 207889c9a7 * nlsfuncs.cc (__set_charset_from_locale): Set default locale for
"uz_UZ" locale to ISO-8859-1, with the "@cyrillic" modifier to UTF-8.
2010-02-05 21:35:34 +00:00
Christopher Faylor e7fd08839e * dll_init.cc (per_module::run_dtors): Use consistent method for running
destructors.
2010-02-05 15:05:22 +00:00
Christopher Faylor 6e3f2c626d * regcomp.c (p_ere): Workaround incorrect compiler warning.
* regerror.c (regatoi): Return non-const string or compiler complains in
certain inexplicable situations.
2010-02-04 21:05:07 +00:00
Corinna Vinschen aec8c3d510 * regex/engine.c (step): Declare and define with `int ch' rather than
`wint_t ch' parameter.  Explain why.
	(NONCHAR): Remove related Cygwin patch here, including wrong comment.
2010-02-04 17:34:44 +00:00
Corinna Vinschen e1e595a649 Replace regex files with multibyte-aware version from FreeBSD.
* Makefile.in (install-headers): Remove extra command to install
	regex.h.
	(uninstall-headers): Remove extra command to uninstall regex.h.
	* nlsfuncs.cc (collate_lcid): Make externally available to allow
	access to collation internals from regex functions.
	(collate_charset): Ditto.
	* wchar.h: Add __cplusplus guards to make C-clean.
	* include/regex.h: New file, replacing regex/regex.h.  Remove UCB
	advertising clause.
	* regex/COPYRIGHT: Accommodate BSD license.  Remove UCB advertising
	clause.
	* regex/cclass.h: Remove.
	* regex/cname.h: New file from FreeBSD.
	* regex/engine.c: Ditto.
	(NONCHAR): Tweak for Cygwin.
	* regex/engine.ih: Remove.
	* regex/mkh: Remove.
	* regex/regcomp.c: New file from FreeBSD.  Tweak slightly for Cygwin.
	Import required collate internals from nlsfunc.cc.
	(p_ere_exp): Add GNU-specific \< and \> handling for word boundaries.
	(p_simp_re): Ditto.
	(__collate_range_cmp): Define.
	(p_b_term): Use Cygwin-specific collate internals.
	(findmust): Ditto.
	* regex/regcomp.ih: Remove.
	* regex/regerror.c: New file from FreeBSD.  Fix a few compiler warnings.
	* regex/regerror.ih: Remove.
	* regex/regex.7: New file from FreeBSD.  Remove UCB advertising clause.
	* regex/regex.h: Remove.  Replaced by include/regex.h.
	* regex/regexec.c: New file from FreeBSD.  Fix a few compiler warnings.
	* regex/regfree.c: New file from FreeBSD.
	* regex/tests: Remove.
	* regex/utils.h: New file from FreeBSD.
2010-02-04 12:35:49 +00:00
Christopher Faylor 66dd5c4ff5 * sigproc.cc (get_proc_lock): Fix error message typo. 2010-02-03 19:57:05 +00:00
Corinna Vinschen 4a49c71595 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Workaround
another bug in NWFS.  Add comment to explain why.  Improve debug output
	in case the NT calls to test for binary fail.
	* path.h (path_conv::fs_is_cifs): New method.
	(path_conv::fs_is_nwfs): New method.
2010-02-03 16:05:33 +00:00
Corinna Vinschen fac3c73ba0 * include/paths.h (_PATH_MNTTAB): Define.
(_PATH_MOUNTED): Define.
	* include/mntent.h: Include paths.h.  Define MNTTAB and MOUNTED as their
	paths.h equivalents.  Add comment.
2010-02-02 11:17:54 +00:00