Skip to content

Commit

Permalink
Fix uinit-var in call to ioctlsocket on Windows #21
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdickmeiss committed Nov 29, 2017
1 parent ee274b6 commit df7a0c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,12 +742,12 @@ static int is_inprogress(void)

static void enable_nonblock(int sock)
{
int flags;
#ifdef WIN32
flags = (flags & CS_FLAGS_BLOCKING) ? 0 : 1;
unsigned long flags = 1;
if (ioctlsocket(sock, FIONBIO, &flags) < 0)
yaz_log(YLOG_FATAL|YLOG_ERRNO, "ioctlsocket");
#else
int flags;
if ((flags = fcntl(sock, F_GETFL, 0)) < 0)
yaz_log(YLOG_FATAL|YLOG_ERRNO, "fcntl");
if (fcntl(sock, F_SETFL, flags | O_NONBLOCK) < 0)
Expand Down

0 comments on commit df7a0c0

Please sign in to comment.