[362] in SIPB_Linux_Development
Re: Zwgc bug that appears on Linux
daemon@ATHENA.MIT.EDU (epeisach@MIT.EDU)
Thu Jan 27 05:59:43 1994
From: epeisach@MIT.EDU
Date: Thu, 27 Jan 1994 05:59:34 -0500
To: bugs@MIT.EDU
Cc: linux-dev@MIT.EDU, marc@MIT.EDU
The code should be changed to check the file descriptor... In all cases
that I can think of, errno is never valid unless the function fails in
the described way. From a man page:
>RETURN VALUES
>
> If the fopen(), fdopen(), or freopen() function fails, a null pointer is
> returned and errno may be set to indicate the error.
You will notice that you must check errno. This all makes sense when you
consider the way that many functions may be coded - calling many
different functions....
So, don't check errno, chec the file descriptor..