diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2005-05-18 10:23:40 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2005-05-18 10:23:40 +0000 |
commit | bffaf54d766a47fbf796042073539ed1c96cbd91 (patch) | |
tree | 0922c56b45fad2a9056694f1a62cde382a9ad108 /winsup | |
parent | f2b664e0ddcdf9285d10ba8fa90882381c29a243 (diff) | |
download | newlib-bffaf54d766a47fbf796042073539ed1c96cbd91.zip newlib-bffaf54d766a47fbf796042073539ed1c96cbd91.tar.gz newlib-bffaf54d766a47fbf796042073539ed1c96cbd91.tar.bz2 |
* fhandler_netdrive.cc (fhandler_netdrive::telldir): Implement.
(fhandler_netdrive::seekdir): Implement.
(fhandler_netdrive::closedir): Call rewinddir to have only one point
of calling WNetCloseEnum.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_netdrive.cc | 14 |
2 files changed, 16 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 8d4e974..2e06516 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2005-05-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_netdrive.cc (fhandler_netdrive::telldir): Implement. + (fhandler_netdrive::seekdir): Implement. + (fhandler_netdrive::closedir): Call rewinddir to have only one point + of calling WNetCloseEnum. + 2005-05-17 Corinna Vinschen <corinna@vinschen.de> * fhandler.h (class fhandler_netdrive): Add method rewinddir. diff --git a/winsup/cygwin/fhandler_netdrive.cc b/winsup/cygwin/fhandler_netdrive.cc index c778a7d..2fde21b 100644 --- a/winsup/cygwin/fhandler_netdrive.cc +++ b/winsup/cygwin/fhandler_netdrive.cc @@ -212,12 +212,18 @@ fhandler_netdrive::readdir (DIR *dir) _off64_t fhandler_netdrive::telldir (DIR *dir) { - return -1; + return dir->__d_position; } void -fhandler_netdrive::seekdir (DIR *, _off64_t) +fhandler_netdrive::seekdir (DIR *dir, _off64_t pos) { + rewinddir (dir); + if (pos < 0) + return; + while (dir->__d_position < pos) + if (!readdir (dir)) + break; } void @@ -232,9 +238,7 @@ fhandler_netdrive::rewinddir (DIR *dir) int fhandler_netdrive::closedir (DIR *dir) { - if (dir->__handle != INVALID_HANDLE_VALUE) - WNetCloseEnum (dir->__handle); - dir->__handle = INVALID_HANDLE_VALUE; + rewinddir (dir); return fhandler_virtual::closedir (dir); } |