Changeset 1476:bcb075f757c8 in roaraudio for libroar/simple.c


Ignore:
Timestamp:
03/30/09 19:40:10 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

do not try BSD Socket interface/POSIX IO if the arch/os does not support that

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/simple.c

    r1470 r1476  
    9999 int fh; 
    100100 
    101  if ( (fh = roar_simple_stream_obj(s, rate, channels, bits, codec, NULL /* server, we hope this goes ok here... */, 
     101 if ( (fh = roar_simple_stream_obj(s, rate, channels, bits, codec, NULL /* server, we hope this is ok here... */, 
    102102                                   dir, "libroar temp stream")) == -1 ) 
    103103  return -1; 
    104104 
    105105 if ( roar_stream_attach_simple(con, s, roar_get_clientid(con)) == -1 ) { 
     106#ifdef ROAR_HAVE_IO_POSIX 
    106107  close(fh); 
     108#endif /* no else as we return -1 anyway */ 
    107109  return -1; 
    108110 } 
     
    143145#endif 
    144146 
     147#ifdef ROAR_HAVE_BSDSOCKETS 
    145148 if ( getsockname(con->fh, (struct sockaddr *)&socket_addr, &len) == -1 ) { 
    146149  return -1; 
    147150 } 
     151#else 
     152 return -1; 
     153#endif 
    148154 
    149155 if ( len == 0 ) { 
     
    323329 
    324330int roar_simple_close(int fh) { 
     331#ifdef ROAR_HAVE_IO_POSIX 
    325332 return close(fh); 
     333#else 
     334 return -1; 
     335#endif 
    326336} 
    327337 
Note: See TracChangeset for help on using the changeset viewer.