diff --git a/applications/jpip/CHANGES b/applications/jpip/CHANGES index 5d3fb0c6..d5cb0663 100644 --- a/applications/jpip/CHANGES +++ b/applications/jpip/CHANGES @@ -7,6 +7,7 @@ What's New for OpenJPIP December 22, 2011 * [kaori] fixed auxtrans_manager to enable MAC +* [kaori] warnings due to disregarding return value are removed November 30, 2011 + [kaori] TCP return (http-tcp) implemented diff --git a/applications/jpip/libopenjpip/jpipstream_manager.c b/applications/jpip/libopenjpip/jpipstream_manager.c index bb1418f7..9a5f91fe 100644 --- a/applications/jpip/libopenjpip/jpipstream_manager.c +++ b/applications/jpip/libopenjpip/jpipstream_manager.c @@ -65,7 +65,8 @@ void save_codestream( Byte_t *codestream, Byte8_t streamlen, char *fmt) sprintf( filename, "%4d%02d%02d%02d%02d%02d.%.3s", t_st->tm_year+1900, t_st->tm_mon+1, t_st->tm_mday, t_st->tm_hour, t_st->tm_min, t_st->tm_sec, fmt); fp = fopen( filename, "wb"); - fwrite( codestream, streamlen, 1, fp); + if( fwrite( codestream, streamlen, 1, fp) != 1) + fprintf( stderr, "Error: failed to write codestream to file %s\n", filename); fclose( fp); } diff --git a/applications/jpip/libopenjpip/msgqueue_manager.c b/applications/jpip/libopenjpip/msgqueue_manager.c index 279054f6..6421ce01 100644 --- a/applications/jpip/libopenjpip/msgqueue_manager.c +++ b/applications/jpip/libopenjpip/msgqueue_manager.c @@ -484,7 +484,10 @@ void add_vbas_with_bytelen_stream( Byte8_t code, int bytelength, int tmpfd) seg = ( code >> (n*7)) & 0x7f; if( n) seg |= 0x80; - write( tmpfd, ( Byte4_t *)&seg, 1); + if( write( tmpfd, ( Byte4_t *)&seg, 1) != 1){ + fprintf( FCGI_stderr, "Error: failed to write vbas\n"); + return; + } n--; } } @@ -532,7 +535,10 @@ void add_bigendian_bytestream( Byte8_t code, int bytelength, int tmpfd) n = bytelength - 1; while( n >= 0) { seg = ( code >> (n*8)) & 0xff; - write( tmpfd, ( Byte4_t *)&seg, 1); + if( write( tmpfd, ( Byte4_t *)&seg, 1) != 1){ + fprintf( FCGI_stderr, "ERROR: failed to write bigendian_bytestream\n"); + return; + } n--; } } diff --git a/applications/jpip/libopenjpip/openjpip.c b/applications/jpip/libopenjpip/openjpip.c index df1e3eb6..f19d7aea 100644 --- a/applications/jpip/libopenjpip/openjpip.c +++ b/applications/jpip/libopenjpip/openjpip.c @@ -147,7 +147,9 @@ void send_responsedata( server_record_t *rec, QR_t *qr) return; } - fwrite( jpipstream, len_of_jpipstream, 1, FCGI_stdout); + if( fwrite( jpipstream, len_of_jpipstream, 1, FCGI_stdout) != 1) + fprintf( FCGI_stderr, "Error: failed to write jpipstream\n"); + free( jpipstream); return; } @@ -160,7 +162,8 @@ void add_EORmsg( int fd, QR_t *qr) EOR[0] = 0x00; EOR[1] = is_allsent( *(qr->channel->cachemodel)) ? 0x01 : 0x02; EOR[2] = 0x00; - write( fd, EOR, 3); + if( write( fd, EOR, 3) != 3) + fprintf( FCGI_stderr, "Error: failed to write EOR message\n"); } }