diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-03-26 10:39:03 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-03-26 10:39:03 +0000 |
commit | 232c9f6c41387bc3cf1c239e0ce4caafbbb76c67 (patch) | |
tree | a59f599bae44be0c0744c370134e7786bc243bbc /src/interface.c | |
parent | 70dbc2b0e76f479961bd0ac326ee6a5d009cc170 (diff) | |
download | mpd-232c9f6c41387bc3cf1c239e0ce4caafbbb76c67.tar.gz mpd-232c9f6c41387bc3cf1c239e0ce4caafbbb76c67.tar.xz mpd-232c9f6c41387bc3cf1c239e0ce4caafbbb76c67.zip |
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
Diffstat (limited to 'src/interface.c')
-rw-r--r-- | src/interface.c | 5 |
1 files changed, 1 insertions, 4 deletions
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; |