diff --git a/library/fcntl_fcntl.c b/library/fcntl_fcntl.c index 6e55f31..22332b9 100644 --- a/library/fcntl_fcntl.c +++ b/library/fcntl_fcntl.c @@ -1,5 +1,5 @@ /* - * $Id: fcntl_fcntl.c,v 1.14 2005-03-25 08:50:59 obarthel Exp $ + * $Id: fcntl_fcntl.c,v 1.15 2005-03-25 08:59:22 obarthel Exp $ * * :ts=4 * @@ -146,7 +146,8 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ ) SHOWMSG("cmd=F_SETFL"); - if(fd->fd_DefaultFile == ZERO) + /* If this is a file, make sure that we don't hit a zero file handle. */ + if(FLAG_IS_CLEAR(fd->fd_Flags,FDF_IS_SOCKET) && fd->fd_DefaultFile == ZERO) { __set_errno(EBADF); goto out;