(try_to_bin): Return bin_status. Rename win32_path to pc. Rename h
to fh. Rename fh to tmp_fh. Add code to set delete dispostion and
more code to replace file moved to bin by another, temporary file.
Add comments to explain why.
(unlink_nt): Replace move_to_bin with bin_stat. Only set bin_stat
to move_to_bin for non-remote files. As a last resort, call try_to_bin
if setting delete-on-close failed. Only re-set R/O DOS attribute
and only close handle if it's still valid.
letter in native path to uppercase.
* path.cc (normalize_win32_path): Ditto.
(path_prefix_p): Revert previous patch.
* path.cc (symlink_info::check): Check for STATUS_INVALID_PARAMETER
return code to circumvent weird behaviour of Samba 3.2.x shares.
where appropriate.
* globals.cc: New file for generic global variables.
* mkglobals_h: New file to generate globals.h.
* mkstatic: New Script used to build a (currently non-working) static
libcygwin_s.a.
* Makefile.in: Add unused rule to build a non-working libcygwin_s.a.
(DLL_OFILES): Add globals.o. Make all objects rely on globals.h.
(globals.h): New target. Generate globals.h.
* cygtls.h: Honor new CYGTLS_HANDLE define to control when the HANDLE operator
is allowed in _cygtls.
* dcrt0.cc: Move most globals to globals.cc.
* init.cc: Ditto.
* environ.cc (strip_title_path): Remove now-unneeded extern.
* fhandler_serial.cc (fhandler_serial::open): Ditto.
* pinfo.cc: Ditto.
(commune_process): Ditto.
* shared.cc: Ditto.
* glob.cc: Ditto.
* strace.cc: Ditto.
* exceptions.cc: Define CYGTLS_HANDLE before including winsup.h.
* path.cc (stat_suffixes): Move here.
* security.h: Add forward class path_conv declaration.
* smallprint.cc (__small_vsprintf): Make a true c++ function.
(__small_sprintf): Ditto.
(small_printf): Ditto.
(console_printf): Ditto.
(__small_vswprintf): Ditto.
(__small_swprintf): Ditto.
* spawn.cc (spawn_guts): Remove _stdcall decoration in favor of regparm.
(hExeced): Move to globals.cc
* strfuncs.cc (current_codepage): Ditto.
(active_codepage): Ditto.
* sync.cc (lock_process::locker): Move here from dcrt0.cc.
* syscalls.cc (stat_suffixes): Move to path.cc.
* tty.cc (tty::create_master): Uncapitalize fatal warning for consistency.
* winsup.h: Include globals.h to declare most of the grab bag list of globals
which were previously defined here.
* mount.h: Move USER_* defines back to shared_info.h.
* speclib: Force temporary directory cleanup.
(smb_extended_info): Move here from path.cc.
(fs_info::update): Ditto.
(mount_info::create_root_entry): Delay conversion to slashes and use passed in
buffer to figure out fs type.
* path.cc (smb_extended_info): Move.
(fs_info::update): Ditto.
* mount.h: New file. Move mount information here.
* path.h: (fs_info::update): Move.
* shared_info.h (mount_item): Ditto.
(fhandler_base::get_overlapped_buffer): Declare new function.
(fhandler_base::set_overlapped): Ditto.
(fhandler_pipe::overlapped): New variable.
(fhandler_pipe::get_overlapped): Rework to return contents of overlapped
variable.
(fhandler_pipe::set_overlapped): Set overlapped variable based on argument.
(fhandler_fifo::get_overlapped_buffer): Return pointer to io_status.
* fhandler.cc (handler_base::setup_overlapped): Set to overlapped pointer to
NULL if new doit parameter is false. Otherwise set up overlapped event as
usual.
(fhandler_base::wait_overlapped): Return inres if this isn't an overlapped
operation.
(fhandler_base::read_overlapped): Remove inappropriate asserts.
* pipe.cc (fhandler_pipe::fhandler_pipe): Zero overlapped element.
(struct pipesync): Delete.
(getov_result): Ditto.
(pipe_handler): Ditto.
(pipesync::pipesync): Ditto.
(fhandler_pipe::init): Don't set up pipesync thread. Just pass opened_properly
flag along to overlapped setup.
(pinfo_basic::pinfo_basic): Define constructor for new class.
(myself): Initialize from myself_initial.
(set_myself): Set pid and progname from already myself_initial.
* strace.cc (strace::strace): Split apart strace::hello. Send notification to
strace as early as possible.
(strace::hello): Just send clause which describes the current process. This
can now be preceded by early initialization strace output.
* include/sys/strace.h (strace::strace): Declare new constructor.
(PERF_DATA_FILE_COUNT): New constant.
(fhandler_registry::exists): Add check for HKEY_PERFORMANCE_DATA
value names.
(fhandler_registry::fstat): For HKEY_PERFORMANCE_DATA, return
default values only.
(fhandler_registry::readdir): For HKEY_PERFORMANCE_DATA, list
names from perf_data_files only.
(fhandler_registry::fill_filebuf): Use larger buffer to speed up
access to HKEY_PERFORMANCE_DATA values. Remove check for possible
subkey. Add RegCloseKey ().
(open_key): Replace goto by break, remove label. Do not try to
open subkey of HKEY_PERFORMANCE_DATA. Add missing RegCloseKey ()
after open subkey error.
NULL throughout.
(fhandler_disk_file::facl): Fix a condition so that fstat_by_handle
is actually used.
(fhandler_disk_file::readdir): Don't print debug message on a simple
STATUS_NO_MORE_FILES status code.
NtQueryDirectoryFile to NULL instead of 0 since it's a pointer.
Simplify label and break from loop handling in symlink evaluation
conditional expression. Drop a now useless break statement. Fix
behaviour when searching for `foo' and then finding a `foo.lnk'
which is no shortcut.
(encode_regname): Encode empty (default) name to "@".
Encode "@" to "%40". Change error return to -1.
(decode_regname): Decode "@" to empty name. Decode "%40" to "@".
(fhandler_registry::exists): Skip check for keys if name is empty.
Remove check for DEFAULT_VALUE_NAME, now handled by decode_regname ().
(fhandler_registry::readdir): Remove check for empty name, now
handled by encode_regname ().
(fhandler_registry::open): Remove check for DEFAULT_VALUE_NAME.
(fhandler_registry::open_key): Fail with ENOENT if key name is empty.
* fhandler_registry.cc (fhandler_registry::exists): Recode goto as if/else to
avoid a gcc4 compiler warning.
(fhandler_registry::open): Ditto. Use one goto rather than two.
* gentls_offsets: Fix compiler warning in generated output.
* tlsoffsets.h: Regenerate.
* mount.cc (fillout_mntent): slashify native paths returned via getmntent.
Append "%val" if add_val is set.
(decode_regname): Remove trailing "%val". Change returncode accordingly.
(__DIR_hash): New class.
(d_hash): New macro.
(key_exists): New function.
(fhandler_registry::exists): Remove encode of registry name before path
compare, decode file part of path instead. Skip checks for keys if
trailing "%val" detected.
(fhandler_registry::fstat): Change check of return value of
decode_regname ().
(fhandler_registry::readdir): Allocate __DIR_hash. Record key names in
hash table. Append "%val" if key with same name exists. Fix error
handling of encode_regname (). Set dirent.d_type.
(fhandler_registry::closedir): Delete __DIR_hash.
(fhandler_registry::open): Don't open key if trailing "%val" detected
by decode_regname ().
(open_key): Ditto.
(res_ninit): Set id pseudo-randomly.
(res_nsend): Do not set close on exec. Initialize server from id.
Flush socket. Tighten rules for answer acceptance.
(res_nmkquery): Update id using current data.
(encode_regname): Ditto.
(decode_regname): Ditto.
(fhandler_registry::exists): Encode name before path compare.
(fhandler_registry::fstat): Pass decoded name to win32 registry call.
(fhandler_registry::readdir): Return encoded name to user.
(fhandler_registry::open): Store decoded name into value_name.
(open_key): Pass decoded name to win32 registry call.