Apply another patch from Kaori, about return value from write/fwrite. Thanks

This commit is contained in:
Mathieu Malaterre
2011-12-23 08:30:36 +00:00
parent f26b96dd5c
commit b82b6cbd05
4 changed files with 16 additions and 5 deletions

View File

@@ -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--;
}
}