diff options
Diffstat (limited to 'winsup/cygwin/dtable.cc')
-rw-r--r-- | winsup/cygwin/dtable.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index e4f2ddfbc..3c91e50af 100644 --- a/winsup/cygwin/dtable.cc +++ b/winsup/cygwin/dtable.cc @@ -287,16 +287,24 @@ 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; } -#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, 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, char *unix_name, + const char *win32_name, int unit) +{ fhandler_base *fh; dev &= FH_DEVMASK; @@ -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) { |