This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgcj/29604] Race condition in ServerSocket.accept()
- From: "daney at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 May 2007 17:20:33 -0000
- Subject: [Bug libgcj/29604] Race condition in ServerSocket.accept()
- References: <bug-29604-7151@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from daney at gcc dot gnu dot org 2007-05-19 18:20 -------
That didn't come out quite right :(.
The close part would be:
========================
int t = dup(fileDes)
dup2(global_always_error_fd, fileDes);
synchronized {
cleanupFD = fileDes;
}
close (t);
synchronized {
if (fileDesInUse == 0) {
close(cleanupFD);
cleanupFD = -1;
}
}
========================
Yeah, that should work.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29604