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:
parent
ecd755d3f8
commit
907b103439
1
THANKS
1
THANKS
@ -6,6 +6,7 @@ suggesting various improvements or submitting actual code.
|
||||
Here is a list of these people. Help us keep it complete and
|
||||
exempt of errors.
|
||||
|
||||
- Erwan Velu
|
||||
- Paul Vixie
|
||||
- Arno Willig
|
||||
- Eric Tanguy
|
||||
|
@ -868,11 +868,11 @@ match_int( INOUT scanner_t * scanner,
|
||||
OUT int *value )
|
||||
{
|
||||
memptr token;
|
||||
token_type_t tok_type;
|
||||
token_type_t tok_type;
|
||||
parse_status_t status;
|
||||
int num;
|
||||
char *end_ptr;
|
||||
size_t save_pos;
|
||||
long num;
|
||||
char *end_ptr;
|
||||
size_t save_pos;
|
||||
|
||||
save_pos = scanner->cursor;
|
||||
|
||||
@ -2391,7 +2391,7 @@ int
|
||||
raw_to_int( IN memptr * raw_value,
|
||||
IN int base )
|
||||
{
|
||||
int num;
|
||||
long num;
|
||||
char *end_ptr;
|
||||
|
||||
if( raw_value->length == 0 ) {
|
||||
|
@ -53,6 +53,10 @@
|
||||
#endif
|
||||
#include "unixutil.h"
|
||||
|
||||
#ifndef MSG_NOSIGNAL
|
||||
#define MSG_NOSIGNAL 0
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
* Function : sock_init
|
||||
*
|
||||
@ -229,7 +233,7 @@ sock_read_write( IN SOCKINFO * info,
|
||||
|
||||
if( bRead ) {
|
||||
// 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 {
|
||||
byte_left = bufsize;
|
||||
bytes_sent = 0;
|
||||
@ -237,7 +241,7 @@ sock_read_write( IN SOCKINFO * info,
|
||||
// write data
|
||||
num_written =
|
||||
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 ) {
|
||||
return num_written;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user