From 91d2f6eebffcc8aa492b59c99f429aa41d09e82e Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 19 Jul 2007 11:41:17 +0000 Subject: * fhandler.cc (fhandler_base::open): Drop local wpath and upath variables. Call pc.get_object_attr to create object attributes. * fhandler_disk_file.cc (fhandler_disk_file::opendir): Ditto. * syscalls.cc (unlink_nt): Ditto. * path.cc (path_conv::set_normalized_path): Set wide_path to NULL. (path_conv::get_nt_native_path): Drop parameter. Create path in wide_path/uni_path members. (path_conv::get_object_attr): New method to create object attributes. (path_conv::get_wide_win32_path): New method to create Win32 wide path. (path_conv::check): Initialize wide_path to NULL. (path_conv::~path_conv): cfree wide_path. * path.h (class path_conv): New members wide_path and uni_path. Add declarations of get_object_attr and get_wide_win32_path. (path_conv::path_conv): Initialize wide_path to NULL. (path_conv::get_nt_native_path): Drop parameter. --- winsup/cygwin/syscalls.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'winsup/cygwin/syscalls.cc') diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 3d9cba259..65aac3b64 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -234,8 +234,6 @@ try_to_bin (path_conv &win32_path, HANDLE h) DWORD unlink_nt (path_conv &win32_name, bool setattrs) { - WCHAR wpath[CYG_MAX_PATH + 10]; - UNICODE_STRING upath = {0, sizeof (wpath), wpath}; OBJECT_ATTRIBUTES attr; IO_STATUS_BLOCK io; NTSTATUS status; @@ -269,9 +267,7 @@ unlink_nt (path_conv &win32_name, bool setattrs) if (win32_name.is_rep_symlink ()) flags |= FILE_OPEN_REPARSE_POINT; - win32_name.get_nt_native_path (upath); - InitializeObjectAttributes (&attr, &upath, OBJ_CASE_INSENSITIVE | OBJ_INHERIT, - NULL, sec_none_nih.lpSecurityDescriptor); + win32_name.get_object_attr (attr, sec_none_nih); /* First try to open the file with sharing not allowed. If the file has an open handle on it, this will fail. That indicates that the file has to be moved to the recycle bin so that it actually disappears -- cgit v1.2.3