Make an assertion give more information

This commit is contained in:
Přemysl Eric Janouch 2015-08-16 21:56:47 +02:00
parent 1a305a1c6b
commit bb2de1fd48
1 changed files with 2 additions and 1 deletions

View File

@ -679,7 +679,8 @@ static bool
set_blocking (int fd, bool blocking)
{
int flags = fcntl (fd, F_GETFL);
hard_assert (flags != -1);
if (flags == -1)
exit_fatal ("%s: %s", "fcntl", strerror (errno));
bool prev = !(flags & O_NONBLOCK);
if (blocking)