diff options
author | Christopher Faylor <me@cgf.cx> | 2005-10-24 19:09:07 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-10-24 19:09:07 +0400 |
commit | 16bbf0cc57288917bca2420513462a0cb9c3ce82 (patch) | |
tree | 872f1287fb857f8d30d784b06dc92f1eef89b8e3 /winsup/cygwin | |
parent | 95baaf8819c879ee742e422d761b4617fcccee77 (diff) |
* cygheap.h (cygheap_fdenum): Remove start_fd stuff.
(cygheap_fdenum::rewind): Ditto.
* pipe.cc (fhandler_pipe::open): Lock fdtab while enumerating.
* times.cc (utimes_worker): Ditto.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/cygheap.h | 7 | ||||
-rw-r--r-- | winsup/cygwin/pipe.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/times.cc | 2 |
4 files changed, 12 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 9c89e25bf..b873c49a3 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2005-10-24 Christopher Faylor <cgf@timesys.com> + + * cygheap.h (cygheap_fdenum): Remove start_fd stuff. + (cygheap_fdenum::rewind): Ditto. + * pipe.cc (fhandler_pipe::open): Lock fdtab while enumerating. + * times.cc (utimes_worker): Ditto. + 2005-10-23 Christopher Faylor <cgf@timesys.com> * cygheap.h (cygheap_fdenum::cygheap_fdenum): Record locked state or diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h index ad4511e5c..c151cd007 100644 --- a/winsup/cygwin/cygheap.h +++ b/winsup/cygwin/cygheap.h @@ -394,14 +394,13 @@ class cygheap_fdget : public cygheap_fdmanip class cygheap_fdenum : public cygheap_fdmanip { - int start_fd; public: - cygheap_fdenum (int start_fd = -1, bool lockit = false) + cygheap_fdenum (bool lockit = false) { locked = lockit; if (lockit) cygheap->fdtab.lock (); - this->start_fd = fd = start_fd < 0 ? -1 : start_fd; + fd = -1; } int next () { @@ -412,7 +411,7 @@ class cygheap_fdenum : public cygheap_fdmanip } void rewind () { - fd = start_fd; + fd = -1; } }; diff --git a/winsup/cygwin/pipe.cc b/winsup/cygwin/pipe.cc index 8d16b1742..440e70396 100644 --- a/winsup/cygwin/pipe.cc +++ b/winsup/cygwin/pipe.cc @@ -49,7 +49,7 @@ fhandler_pipe::open (int flags, mode_t mode) sscanf (get_name (), "/proc/%d/fd/pipe:[%d]", &pid, (int *) &pipe_hdl); if (pid == myself->pid) { - cygheap_fdenum cfd; + cygheap_fdenum cfd (true); while (cfd.next () >= 0) { if (cfd->get_handle () != pipe_hdl) diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc index 4ceb093ef..7bb961d75 100644 --- a/winsup/cygwin/times.cc +++ b/winsup/cygwin/times.cc @@ -454,7 +454,7 @@ utimes_worker (const char *path, const struct timeval *tvp, int nofollow) fhandler_base *fh = NULL; bool fromfd = false; - cygheap_fdenum cfd; + cygheap_fdenum cfd (true); while (cfd.next () >= 0) if (cfd->get_access () & (FILE_WRITE_ATTRIBUTES | GENERIC_WRITE) && strcmp (cfd->get_win32_name (), win32) == 0) |