From 232c9f6c41387bc3cf1c239e0ce4caafbbb76c67 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 26 Mar 2008 10:39:03 +0000 Subject: notify: cleanups * move set_nonblock{,ing}() into utils.c since we use it elsewhere, too * add proper error checking to set_nonblocking() * use os_compat.h instead of individually #includ-ing system headers git-svn-id: https://svn.musicpd.org/mpd/trunk@7217 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/inputStream_http.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/inputStream_http.c') diff --git a/src/inputStream_http.c b/src/inputStream_http.c index 23434beb6..e633b7a66 100644 --- a/src/inputStream_http.c +++ b/src/inputStream_http.c @@ -357,7 +357,7 @@ static int initHTTPConnection(InputStream * inStream) struct addrinfo *ans = NULL; struct addrinfo *ap = NULL; struct addrinfo hints; - int error, flags; + int error; InputStreamHTTPData *data = (InputStreamHTTPData *) inStream->data; /** * Setup hints @@ -397,8 +397,7 @@ static int initHTTPConnection(InputStream * inStream) return -1; } - flags = fcntl(data->sock, F_GETFL, 0); - fcntl(data->sock, F_SETFL, flags | O_NONBLOCK); + set_nonblocking(data->sock); if (connect(data->sock, ap->ai_addr, ap->ai_addrlen) >= 0 || errno == EINPROGRESS) { -- cgit v1.2.3