From b3d03822e44d7f2c438e6ad742d9a170849595c5 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 13 Jul 2010 11:06:08 -0400 Subject: [PATCH] Pass flags to fcntl(F_SETFL) as int, not long Everybody but Linux documents this as taking an int, and Linux is very tolerant of getting an int instead. If it weren't, everybody doing fcntl(fd,F_SETFL,O_NONBLOCK) would break, since the glibc headers define O_NONBLOCK as an int literal. --- evutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evutil.c b/evutil.c index 93c30225..cc6d0f46 100644 --- a/evutil.c +++ b/evutil.c @@ -169,7 +169,7 @@ evutil_make_socket_nonblocking(int fd) } #else { - long flags; + int flags; if ((flags = fcntl(fd, F_GETFL, NULL)) < 0) { event_warn("fcntl(%d, F_GETFL)", fd); return -1;