fcntl(.., F_SETFL, ..) should only do an FIOASYNC ioctl if the FASYNC
authorMatthew Dillon <dillon@dragonflybsd.org>
Wed, 14 Jun 2006 16:58:04 +0000 (16:58 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Wed, 14 Jun 2006 16:58:04 +0000 (16:58 +0000)
commitf58b505bc2034a595dad4c09c101933bbf6f060e
tree979a6eeb957aa36cf41e35142bf0ba05b0fae58e
parent6c771dda6deef097f5c4a21bc9b83b733ad14ee5
fcntl(.., F_SETFL, ..) should only do an FIOASYNC ioctl if the FASYNC
bit has changed.   Otherwise a program just trying to set O_NONBLOCK might
get an error from devices that don't like FIOASYNC.

The 'pty' device master will fail on FIOASYNC if the slave has not been
opened.  This bug caused rxvt to hang, but rxvt only set O_NONBLOCK and
wasn't really at fault.

Reported-by: Johannes Hofmann <Johannes.Hofmann@gmx.de>
sys/kern/kern_descrip.c