Changeset 6029:c25f9d9f78a6 in roaraudio for libroar/vio_winsock.c


Ignore:
Timestamp:
07/15/14 11:07:45 (10 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

some smaller improvements in error handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/vio_winsock.c

    r5961 r6029  
    4848 
    4949ssize_t roar_vio_winsock_read    (struct roar_vio_calls * vio, void *buf, size_t count) { 
    50  return recv(_get_fh(vio), buf, count, 0); 
     50 ssize_t ret; 
     51 
     52 roar_err_clear_all(); 
     53 ret = recv(_get_fh(vio), buf, count, 0); 
     54 roar_err_update(); 
     55 
     56 return ret; 
    5157} 
    5258 
    5359ssize_t roar_vio_winsock_write   (struct roar_vio_calls * vio, void *buf, size_t count) { 
    54  return send(_get_fh(vio), buf, count, 0); 
     60 ssize_t ret; 
     61 
     62 roar_err_clear_all(); 
     63 ret = send(_get_fh(vio), buf, count, 0); 
     64 roar_err_update(); 
     65 
     66 return ret; 
    5567} 
    5668 
     
    7082 switch (cmd) { 
    7183  case ROAR_VIO_CTL_GET_NAME: 
    72     if ( data == NULL ) 
     84    if ( data == NULL ) { 
     85     roar_err_set(ROAR_ERROR_FAULT); 
    7386     return -1; 
     87    } 
    7488 
    7589    *(char**)data = "winsock"; 
     
    88102   break; 
    89103  case ROAR_VIO_CTL_ACCEPT: 
     104    roar_err_clear_all(); 
    90105    tmp = accept(_get_fh(vio), NULL, 0); 
     106    roar_err_update(); 
    91107    if ( tmp == -1 ) 
    92108     return -1; 
     
    113129    } 
    114130 
    115     if ( tmp != 0 ) /* we currently only support R and W shutdowns */ 
     131    if ( tmp != 0 ) { /* we currently only support R and W shutdowns */ 
     132     roar_err_set(ROAR_ERROR_NOSYS); 
    116133     return -1; 
     134    } 
    117135 
    118136    if ( s_r && s_w ) { 
Note: See TracChangeset for help on using the changeset viewer.