Changeset 3238:17ff06e30255 in roaraudio for libroarsndio


Ignore:
Timestamp:
01/28/10 09:44:35 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

support for IO errors in libroarsndio

Location:
libroarsndio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libroarsndio/libroarsndio.c

    r3237 r3238  
    166166 
    167167int    sio_eof    (struct sio_hdl * hdl) { 
    168  return 0; 
     168 return hdl->ioerror; 
    169169} 
    170170 
  • libroarsndio/stream.c

    r3237 r3238  
    102102 
    103103 hdl->stream_opened = 1; 
     104 hdl->ioerror       = 0; 
    104105 
    105106 return 1; 
     
    131132  return 0; 
    132133 
    133  if ( (ret = roar_vio_read(&(hdl->svio), addr, nbytes)) < 0 ) 
     134 if ( (ret = roar_vio_read(&(hdl->svio), addr, nbytes)) < 0 ) { 
     135  hdl->ioerror = 1; 
    134136  return 0; 
     137 } 
     138 
     139 if ( hdl->nonblock ) 
     140  hdl->ioerror = 0; 
    135141 
    136142 return ret; 
     
    145151  return 0; 
    146152 
    147  if ( (ret = roar_vio_write(&(hdl->svio), (void*) addr, nbytes)) < 0 ) 
     153 if ( (ret = roar_vio_write(&(hdl->svio), (void*) addr, nbytes)) < 0 ) { 
     154  hdl->ioerror = 1; 
    148155  return 0; 
     156 } 
     157 
     158 if ( hdl->nonblock ) 
     159  hdl->ioerror = 0; 
    149160 
    150161 if ( hdl->on_move != NULL ) { 
Note: See TracChangeset for help on using the changeset viewer.