diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-04-13 19:08:38 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-04-13 19:08:38 +0000 |
commit | 860f8bda714da8724777e47829e751585b4ca288 (patch) | |
tree | 293daaf8f52314a9fe2b63fb7bb75c54909e42bc /src/interface.c | |
parent | 5a50fa7147be049212274534ccfbf7ed14708070 (diff) | |
download | mpd-860f8bda714da8724777e47829e751585b4ca288.tar.gz mpd-860f8bda714da8724777e47829e751585b4ca288.tar.xz mpd-860f8bda714da8724777e47829e751585b4ca288.zip |
ok, rework myfprintf so it uses write() and never use any file stream
print functions. this way we can always know wtf is going on!
also, remove some places where we were using fprintf and printf instead of
myfprintf
git-svn-id: https://svn.musicpd.org/mpd/trunk@734 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/interface.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/interface.c b/src/interface.c index 9499d1049..83699e2f0 100644 --- a/src/interface.c +++ b/src/interface.c @@ -84,14 +84,13 @@ void openInterface(Interface * interface, int fd) { assert(interface->open==0); - blockSignals(); interface->bufferLength = 0; interface->fd = fd; /* fcntl(interface->fd,F_SETOWN,(int)getpid()); */ - flags = fcntl(fd,F_GETFL); + while((flags = fcntl(fd,F_GETFL))<0 && errno==EINTR); flags|=O_NONBLOCK; - fcntl(interface->fd,F_SETFL,flags); - interface->fp = fdopen(fd,"rw"); + while(fcntl(interface->fd,F_SETFL,flags)<0 && errno==EINTR); + while((interface->fp = fdopen(fd,"rw"))==NULL && errno==EINTR); interface->open = 1; interface->lastTime = time(NULL); interface->commandList = NULL; @@ -121,8 +120,6 @@ void openInterface(Interface * interface, int fd) { #endif interface->outBuffer = malloc(interface->outBufSize); - unblockSignals(); - myfprintf(interface->fp,"%s %s %s\n",COMMAND_RESPOND_OK,GREETING, VERSION); printInterfaceOutBuffer(interface); |