do not potentially pass -1 to fcntl()

This commit is contained in:
Christian Grothoff 2017-10-06 21:23:29 +02:00
parent 7f37c2ae00
commit 8f08e4634f
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -1060,9 +1060,10 @@ main (int argc,
fh_admin = -1; fh_admin = -1;
} }
flags |= FD_CLOEXEC; flags |= FD_CLOEXEC;
if (0 != fcntl (fh_admin, if ( (-1 != fh_admin) &&
F_SETFD, (0 != fcntl (fh_admin,
flags)) F_SETFD,
flags)) )
GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR,
"fcntl"); "fcntl");
} }