diff options
author | Christopher Faylor <me@cgf.cx> | 2001-09-22 21:44:07 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-09-22 21:44:07 +0000 |
commit | 9854ada7547fab60f8283aad78deff6011ac4d5b (patch) | |
tree | 739a6e9dcdf341d39cc2c9238d713896ed711312 /winsup/cygwin/syscalls.cc | |
parent | 880230dc7cb0fb299d2114ae4fb10efa7bcda626 (diff) | |
download | cygnal-9854ada7547fab60f8283aad78deff6011ac4d5b.tar.gz cygnal-9854ada7547fab60f8283aad78deff6011ac4d5b.tar.bz2 cygnal-9854ada7547fab60f8283aad78deff6011ac4d5b.zip |
* dtable.cc (dtable::build_fhandler): Accept an optional path_conv argument.
If available, use this to calculate path name and device number.
* dtable.h (dtable): Reflect above change.
* fhandler.h (fhandler_base): Declare virtual method which accepts path_conv
rather than path string as first argument.
* fhandler.cc (fhandler_base::open): Define above new method.
* syscalls.cc (_open): Set aside a path_conv variable for use in build_fhandler
and subsequent call to open.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index a98b23a50..19d259a0a 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -484,15 +484,19 @@ _open (const char *unix_path, int flags, ...) if (fd < 0) set_errno (ENMFILE); - else if ((fh = cygheap->fdtab.build_fhandler (fd, unix_path, NULL)) == NULL) - res = -1; // errno already set - else if (!fh->open (unix_path, flags, (mode & 07777) & ~cygheap->umask)) + else { - cygheap->fdtab.release (fd); - res = -1; + path_conv pc; + if ((fh = cygheap->fdtab.build_fhandler (fd, unix_path, NULL, &pc)) == NULL) + res = -1; // errno already set + else if (!fh->open (pc, flags, (mode & 07777) & ~cygheap->umask)) + { + cygheap->fdtab.release (fd); + res = -1; + } + else if ((res = fd) <= 2) + set_std_handle (res); } - else if ((res = fd) <= 2) - set_std_handle (res); ReleaseResourceLock (LOCK_FD_LIST,WRITE_LOCK|READ_LOCK," open"); } |