workaround for Linux-applications that do not catch SIGPIPE backported

git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@76 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Oxy 2006-08-07 05:49:19 +00:00
parent ecd755d3f8
commit 907b103439
3 changed files with 12 additions and 7 deletions

1
THANKS
View File

@ -6,6 +6,7 @@ suggesting various improvements or submitting actual code.
Here is a list of these people. Help us keep it complete and Here is a list of these people. Help us keep it complete and
exempt of errors. exempt of errors.
- Erwan Velu
- Paul Vixie - Paul Vixie
- Arno Willig - Arno Willig
- Eric Tanguy - Eric Tanguy

View File

@ -870,7 +870,7 @@ match_int( INOUT scanner_t * scanner,
memptr token; memptr token;
token_type_t tok_type; token_type_t tok_type;
parse_status_t status; parse_status_t status;
int num; long num;
char *end_ptr; char *end_ptr;
size_t save_pos; size_t save_pos;
@ -2391,7 +2391,7 @@ int
raw_to_int( IN memptr * raw_value, raw_to_int( IN memptr * raw_value,
IN int base ) IN int base )
{ {
int num; long num;
char *end_ptr; char *end_ptr;
if( raw_value->length == 0 ) { if( raw_value->length == 0 ) {

View File

@ -53,6 +53,10 @@
#endif #endif
#include "unixutil.h" #include "unixutil.h"
#ifndef MSG_NOSIGNAL
#define MSG_NOSIGNAL 0
#endif
/************************************************************************ /************************************************************************
* Function : sock_init * Function : sock_init
* *
@ -229,7 +233,7 @@ sock_read_write( IN SOCKINFO * info,
if( bRead ) { if( bRead ) {
// read data // read data
numBytes = recv( sockfd, buffer, bufsize,0); // MSG_NOSIGNAL is not a good idea in portable code, here SIGPIPE/SIGEPIPE has to be used instead numBytes = recv( sockfd, buffer, bufsize,MSG_NOSIGNAL);
} else { } else {
byte_left = bufsize; byte_left = bufsize;
bytes_sent = 0; bytes_sent = 0;
@ -237,7 +241,7 @@ sock_read_write( IN SOCKINFO * info,
// write data // write data
num_written = num_written =
send( sockfd, buffer + bytes_sent, byte_left, send( sockfd, buffer + bytes_sent, byte_left,
MSG_DONTROUTE); // | MSG_NOSIGNAL is not a good idea in portable code, here SIGPIPE/SIGEPIPE has to be used instead MSG_DONTROUTE|MSG_NOSIGNAL);
if( num_written == -1 ) { if( num_written == -1 ) {
return num_written; return num_written;
} }