Changeset 886


Ignore:
Timestamp:
06/23/06 17:15:57 (7 years ago)
Author:
spa1
Message:

Added some better error checking to the connection stage of format_rt
Fixed outdated documentation in libtrace.h
Removed warning about demote_packet in format_erf

Location:
trunk/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/format_erf.c

    r853 r886  
    941941                do { 
    942942                        type=libtrace_to_erf_type(trace_get_link_type(packet)); 
    943                 } while(type==(char)-1 && demote_packet(packet)); 
     943                } while(type==(char)-1 && demote_packet((libtrace_packet_t *)packet)); 
    944944                /* We just don't support this link type sorry */ 
    945945                if (type==(char)-1) { 
  • trunk/lib/format_rt.c

    r806 r886  
    102102         
    103103        if ((he=gethostbyname(RT_INFO->hostname)) == NULL) { 
    104                 perror("gethostbyname"); 
    105                 return -1; 
     104                trace_set_err(libtrace, TRACE_ERR_INIT_FAILED, 
     105                                "Failed to convert hostname %s to address", 
     106                                RT_INFO->hostname); 
     107                return -1; 
    106108        } 
    107109        if ((RT_INFO->input_fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) { 
    108                 perror("socket"); 
    109                 return -1; 
     110                trace_set_err(libtrace, TRACE_ERR_INIT_FAILED, 
     111                                "Could not create socket"); 
     112                return -1; 
    110113        } 
    111114 
  • trunk/lib/libtrace.h.in

    r876 r886  
    11431143 * @return opaque pointer pointer to a libtrace_filter_t object 
    11441144 * @note The filter is not actually compiled at this point, so no correctness 
    1145  * tests are performed here. trace_bpf_setfilter will always return ok, but 
     1145 * tests are performed here. trace_create_filter will always return ok, but 
    11461146 * if the filter is poorly constructed an error will be generated when the  
    11471147 * filter is actually used 
Note: See TracChangeset for help on using the changeset viewer.