Fix fcntl(fd, F_SETFL, x) not setting the descriptor flags properly.

This commit is contained in:
Jonas 'Sortie' Termansen 2014-01-16 20:44:18 +01:00
parent 187cdf03dc
commit cab62b77d5
1 changed files with 1 additions and 1 deletions

View File

@ -122,7 +122,7 @@ bool Descriptor::SetFlags(int new_dflags)
// would kinda prevent concurrency on the same file descriptor. Since
// the chances of this becoming a problem is rather slim (but could
// happen!), we'll do the unsafe thing for now. (See below also)
dflags = (dflags & ~DESCRIPTOR_FLAGS) & (new_dflags & DESCRIPTOR_FLAGS);
dflags = (dflags & ~DESCRIPTOR_FLAGS) | (new_dflags & DESCRIPTOR_FLAGS);
return true;
}