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/interface.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/interface.c') diff --git a/src/interface.c b/src/interface.c index a36131cec..00e009307 100644 --- a/src/interface.c +++ b/src/interface.c @@ -127,8 +127,6 @@ static void set_send_buf_size(Interface * interface) static void openInterface(Interface * interface, int fd) { - int flags; - assert(interface->fd < 0); interface->cmd_list_size = 0; @@ -137,8 +135,7 @@ static void openInterface(Interface * interface, int fd) interface->bufferLength = 0; interface->bufferPos = 0; interface->fd = fd; - while ((flags = fcntl(fd, F_GETFL)) < 0 && errno == EINTR) ; - while (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0 && errno == EINTR) ; + set_nonblocking(fd); interface->lastTime = time(NULL); interface->cmd_list = NULL; interface->cmd_list_tail = NULL; -- cgit v1.2.3