From 860f8bda714da8724777e47829e751585b4ca288 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Tue, 13 Apr 2004 19:08:38 +0000 Subject: 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 --- src/interface.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/interface.c') 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); -- cgit v1.2.3