* delqueue.cc: Delete.
* fhandler.h (fhandler_base::close_fs): Drop declaration.
(fhandler_disk_file::close): Drop declaration.
* fhandler_disk_file.cc (fhandler_base::fstat_fs): Call close instead of
close_fs.
(fhandler_base::fstat_helper): Use open FH_UNIX handle in call to
get_file_attribute.
(fhandler_base::open_fs): Call close instead of get_file_attribute.
(fhandler_disk_file::close): Remove.
(fhandler_base::close_fs): Remove.
* fhandler_socket.cc (fhandler_socket::close): Just call
fhandler_base::close for FH_UNIX sockets.
* shared.cc (user_shared_initialize): Drop call to
user_shared->delqueue.init.
* shared_info.h (CURR_USER_MAGIC): Change according to below change.
(MAX_DELQUEUES_PENDING): Remove.
(class delqueue_list): Remove.
(class user_info): Remove delqueue.
* syscalls.cc (close_all_files): Drop call to
user_shared->delqueue.process_queue.
(unlink): Drop delqueue handling.
(STATUS_OBJECT_PATH_NOT_FOUND): Define.
(STATUS_BUFFER_OVERFLOW): Define.
(FILE_SUPERSEDED): Define.
(FILE_OPENED): Define.
(FILE_CREATED): Define.
(FILE_OVERWRITTEN): Define.
(FILE_EXISTS): Define.
(FILE_DOES_NOT_EXIST): Define.
(PIO_APC_ROUTINE): Typedef.
(NtFsControlFile): Fix parameter types to use PIO_APC_ROUTINE.
(NtWriteFile): Declare.
(RtlInt64ToHexUnicodeString): Declare.
* strfuncs.cc: Include ntdll.h.
(RtlInt64ToHexUnicodeString): New function.
* syscalls.cc (try_to_bin): Rewrite using native NT functions.
Only try to create recycle bin after unsuccessfully trying to move
file. Also try to create special files in recycle bin so that Windows
Explorer isn't unnecessarily stampeded.
2007-07-12 Daniel Jacobowitz <dan@codesourcery.com>
* arm/syscalls.c (_stat): Use _close
* arm/syscalls.c (struct poslog): Rename to...
(struct fdent): ... this.
(FILE_HANDLE_OFFSET): Remove.
(findslot): Return a struct fdent* if fd is valid, otherwise return NULL.
(newslot): New function.
(remap_handle): Remove.
(initialise_monitor_handles): Use stdout as fallback for stderr.
(wrap): Rename to...
(checkerror): ... this.
(_swiread): Use checkerror() for the return of SWI calls. Correct the use of r0.
(_read): Use findslot(). Return EBADF on bad handle.
(_swilseek): Call findslot(). Check for valid whence. Check for negative offset when using
SEEK_CUR, and check for overflow. Use checkerror(). Check *_Flen calls for errors.
(_swiwrite): Correct the use of r0.
(_write): Call findslot().
(_swiopen): Call findslot(). Check for valid flags. Use checkerror(). Call newslot().
Handle O_TRUNC, and O_WRONLY. Return index into openfiles[] for fd.
(_swiclose): Correct the use of r0.
(_close): Handle stderr == stdout case. Only reclaim handle if _swiclose succeeded.
(_getpid): Use __attribute__((unused)).
(_sbrk): Fix formatting.
(_swistat): New function.
(_stat): Call _swistat().
(_fstat): Call _swistat().
(_unlink): Correct the use of r0.
(isatty): Call finslot(). Correct the use of r0.
(_system): Call checkerror(). Correct the use of r0.
(_rename): Correct the use of r0.
separators, require them to be existing directories if so. Check
for a request to change only the case of the filename. Check paths
for case insensitve equality only once. Handle renaming a directory
to another, existing directory by unlinking the destination directory
first. If newpath points to an existing file with R/O attribute set,
try to unset R/O attribute first. Augment hardlink test by not
checking directories. If renaming fails with STATUS_ACCESS_DENIED,
try to unlink existing destination filename and try renaming again.
Drop useless test for non-empty directory. Always close fh at the
end of the function.
trying to rename it. Use nfh handle when checking for non-empty
newpath directory. Only change status if check_dir_not_empty really
returns STATUS_DIRECTORY_NOT_EMPTY.
* libc/sys/linux/intl/Makefile.am: Change stpcpy reference to
lcl_stpcpy to avoid conflict with new stpcpy.c in libc/string.
* libc/sys/linux/intl/Makefile.in: Regenerated.
* libc/sys/linux/intl/stpcpy.c: Renamed to...
* libc/sys/linux/intl/lcl_stpcpy.c: ..this.
dependency-filtering $(wordlist ...) call appropriately. Link ntdll.
(bloda.o): New rule to build bloda.o
* cygcheck.cc (dump_sysinfo): Call bloda function dump_dodgy_apps().
* bloda.cc: New file implements detection of applications from the
Big List Of Dodgy Apps.
oldpath and newpath referring to the same file. Test if oldpath
has more than one hardlink before opening oldpath (idea by Eric Blake).
Reorder test so that file id is tested before volume serial number.
* syscalls.cc (check_dir_not_empty): New static function.
(unlink_nt): Move code checking for non-empty dir to check_dir_not_empty
and call check_dir_not_empty instead.
(rename): Add fault handler. Check oldpath and newpath for trailing
. and .. path components and return EINVAL if so. Check oldpath
for being on a vrtual file system. If renaming a dir fails with
STATUS_ACCESS_DENIED, check if the target dir is non-empty and return
ENOTEMPTY if so.
* libc/stdio/findfp.c (__sinit): Open stderr read/write.
* libc/stdio/fdopen.c (_fdopen_r): Set O_APPEND on fd when
requested.
* libc/stdio64/fdopen64.c (_fdopen64_r): Likewise.
for binary in case of .exe files.
* ntdll.h (RtlPrefixUnicodeString): Declare.
* path.cc (path_conv::is_binary): New method.
* path.h (path_conv::is_binary): Declare.
* syscalls.cc (rename_append_suffix): New static helper function for
rename.
(rename): Rewrite. New suffix tests. Use native NT functions.
opened for reading the ACLs, fall back to faking them.
* sec_acl.cc (acl_worker): Handle non-existing files.
* security.cc (get_file_attribute): Return ILLEGAL_UID/ILLEGAL_GID
as owner/group for non-readable ACLs on file systems supporting them.