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

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)