* dtable.cc (dtable::build_fhandler_from_name): Just pass posix path along to
set_name via return_and_clear_normalized_path. (dtable::build_fhandler): New method with const char * argument. (dtable::reset_unix_path_name): Eliminate. (dtable::dup_worker): Use correct build_fhandler method. * mmap.cc (mmap_record::alloc_fh): Ditto. * dtable.h (dtable::build_fhandler): New method. (dtable::reset_unix_path_name): Eliminate. * fhandler.cc (fhandler_base::set_name): Assume that unix_name has already been cmalloced. (fhandler_base::reset_unix_path_name): Eliminate. (fhandler_base::~fhandler_base): Coercion for cfree. * fhandler.h (fhandler_base::unix_path_name): Make const char *. (fhandler_base::win32_path_name): Ditto. (fhandler_base::reset_unix_path_name): Eliminate. * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Accommodate const char *ness of win32_path_name. * fhandler_socket.cc (fhandler_socket::fstat): Accommodate new set_name requirements. * path.cc (path_conv::return_and_clear_normalized_path): New method. (path_conv::clear_normalized_path): Eliminate. (path_conv::~path_conv): Ditto. (path_conv::check): Accommodate new build_fhandler method. * path.h (path_conv::~path_conv): Eliminate. (path_conv::clear_normalized_path): Ditto. (path_conv::return_and_clear_normalized_path): Declare new method.
This commit is contained in:
@ -287,14 +287,22 @@ dtable::build_fhandler_from_name (int fd, const char *name, HANDLE handle,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fhandler_base *fh = build_fhandler (fd, pc.get_devn (), pc.normalized_path, pc, pc.get_unitn ());
|
||||
pc.clear_normalized_path ();
|
||||
fhandler_base *fh = build_fhandler (fd, pc.get_devn (),
|
||||
pc.return_and_clear_normalized_path (),
|
||||
pc, pc.get_unitn ());
|
||||
return fh;
|
||||
}
|
||||
|
||||
fhandler_base *
|
||||
dtable::build_fhandler (int fd, DWORD dev, const char *unix_name,
|
||||
const char *win32_name, int unit)
|
||||
{
|
||||
return build_fhandler (fd, dev, cstrdup (unix_name), win32_name, unit);
|
||||
}
|
||||
|
||||
#define cnew(name) new ((void *) ccalloc (HEAP_FHANDLER, 1, sizeof (name))) name
|
||||
fhandler_base *
|
||||
dtable::build_fhandler (int fd, DWORD dev, const char *unix_name,
|
||||
dtable::build_fhandler (int fd, DWORD dev, char *unix_name,
|
||||
const char *win32_name, int unit)
|
||||
{
|
||||
fhandler_base *fh;
|
||||
@ -400,7 +408,7 @@ dtable::build_fhandler (int fd, DWORD dev, const char *unix_name,
|
||||
fhandler_base *
|
||||
dtable::dup_worker (fhandler_base *oldfh)
|
||||
{
|
||||
fhandler_base *newfh = build_fhandler (-1, oldfh->get_device (), NULL);
|
||||
fhandler_base *newfh = build_fhandler (-1, oldfh->get_device ());
|
||||
*newfh = *oldfh;
|
||||
newfh->set_io_handle (NULL);
|
||||
if (oldfh->dup (newfh))
|
||||
@ -478,14 +486,6 @@ done:
|
||||
return res;
|
||||
}
|
||||
|
||||
void
|
||||
dtable::reset_unix_path_name (int fd, const char *name)
|
||||
{
|
||||
SetResourceLock (LOCK_FD_LIST, WRITE_LOCK | READ_LOCK, "reset_unix_name");
|
||||
fds[fd]->reset_unix_path_name (name);
|
||||
ReleaseResourceLock (LOCK_FD_LIST, WRITE_LOCK | READ_LOCK, "reset_unix_name");
|
||||
}
|
||||
|
||||
select_record *
|
||||
dtable::select_read (int fd, select_record *s)
|
||||
{
|
||||
|
Reference in New Issue
Block a user