Changeset 205809b for lib/format_linux.c


Ignore:
Timestamp:
02/01/07 14:06:43 (14 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
d242ea8
Parents:
d5a27e8
Message:

Error handling in trace_config is now much more robust - it doesn't overwrite error messages set by the format module and it will clear the format module's error if trace_config can successfully deal with the option (such as filtering).
Added some trace_set_errs to linuxnative_start as it would give absolutely no indication why things failed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_linux.c

    rd5a27e8 r205809b  
    100100                                socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
    101101        if (FORMAT(libtrace->format_data)->fd==-1) {
     102                trace_set_err(libtrace, TRACE_ERR_INIT_FAILED, "Could not create raw socket");
    102103                free(libtrace->format_data);
    103104                return -1;
     
    109110                if (addr.sll_ifindex == 0) {
    110111                        close(FORMAT(libtrace->format_data)->fd);
     112                        trace_set_err(libtrace, TRACE_ERR_INIT_FAILED, "Failed to find interface %s", libtrace->uridata);
    111113                        free(libtrace->format_data);
    112114                        return -1;
     
    120122                                (socklen_t)sizeof(addr))==-1) {
    121123                free(libtrace->format_data);
     124                trace_set_err(libtrace, TRACE_ERR_INIT_FAILED, "Failed to bind to interface %s", libtrace->uridata);
    122125                return -1;
    123126        }
     
    217220                 */
    218221        }
     222       
    219223        trace_set_err(libtrace,TRACE_ERR_UNKNOWN_OPTION,
    220224                        "Unknown option %i", option);
Note: See TracChangeset for help on using the changeset viewer.