From: hyc Date: Sun, 22 Nov 2009 22:08:35 +0000 (+0000) Subject: Just ignore SIGPIPE, MSG_NOSIGNAL is Linux-specific X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46cd4f5d69e90f370f8e5cdf008bc81afa471799;p=rtmpdump Just ignore SIGPIPE, MSG_NOSIGNAL is Linux-specific git-svn-id: svn://svn.mplayerhq.hu/rtmpdump@56 400ebc74-4327-4243-bc38-086b20814532 --- diff --git a/streams.cpp b/streams.cpp index 34158b4..0cbef98 100644 --- a/streams.cpp +++ b/streams.cpp @@ -661,7 +661,7 @@ void processTCPrequest // write FLV header first nRead = WriteHeader(&buffer, PACKET_SIZE); if(nRead > 0) { - nWritten = send(sockfd, buffer, nRead, MSG_NOSIGNAL); + nWritten = send(sockfd, buffer, nRead, 0); if(nWritten < 0) { Log(LOGERROR, "%s, sending failed, error: %d", __FUNCTION__, GetSockError()); goto cleanup; // we are in STREAMING_IN_PROGRESS, so we'll go to STREAMING_ACCEPTING @@ -680,7 +680,7 @@ void processTCPrequest if(nRead > 0) { - nWritten = send(sockfd, buffer, nRead, MSG_NOSIGNAL); + nWritten = send(sockfd, buffer, nRead, 0); //Log(LOGDEBUG, "written: %d", nWritten); if(nWritten < 0) { Log(LOGERROR, "%s, sending failed, error: %d", __FUNCTION__, GetSockError()); @@ -1025,6 +1025,7 @@ int main(int argc, char **argv) }; signal(SIGINT, sigIntHandler); + signal(SIGPIPE, SIG_IGN); while((opt = getopt_long(argc, argv, "hvqVzr:s:t:p:a:f:u:n:c:l:y:m:d:D:A:B:g:w:x:", longopts, NULL)) != -1) { switch(opt) {