Changeset 5033:f4c9b2b4d072 in roaraudio for libroar/vio_socket.c


Ignore:
Timestamp:
05/28/11 21:08:01 (13 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

better error handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/vio_socket.c

    r4708 r5033  
    418418 char           * ts; 
    419419 
    420  if ( service == NULL || domain == -1 || type == -1 ) 
    421   return -1; 
     420 if ( service == NULL || domain == -1 || type == -1 ) { 
     421  roar_err_set(ROAR_ERROR_FAULT); 
     422  return -1; 
     423 } 
    422424 
    423425 if ( (ts = strstr(service, "/")) != NULL ) 
     
    454456     return 0; 
    455457 
     458    roar_err_set(ROAR_ERROR_NOENT); 
    456459    return -1; 
    457460#endif 
     
    459462#endif 
    460463  default: 
     464    roar_err_set(ROAR_ERROR_NOTSUP); 
    461465    return -1; 
    462466 } 
     
    467471 
    468472 if ( (serv = getservbyname(service, proto)) == NULL ) { 
    469   ROAR_ERR("roar_vio_socket_get_port(*): Unknown service: %s/%s: %s", service, proto, strerror(errno)); 
     473  roar_err_from_errno(); 
     474  ROAR_DBG("roar_vio_socket_get_port(*): Unknown service: %s/%s: %s", service, proto, strerror(errno)); 
    470475 
    471476  if ( ts != NULL ) 
     
    481486#endif 
    482487 
     488 
     489 roar_err_set(ROAR_ERROR_NOTSUP); 
    483490 return -1; 
    484491} 
Note: See TracChangeset for help on using the changeset viewer.