Changeset 91b72d3 for lib/format_dag25.c


Ignore:
Timestamp:
01/05/09 11:29:11 (13 years ago)
Author:
Perry Lorier <perry@…>
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:
ad36006
Parents:
9d0049cf
Message:

Try to autoguess the tracetype if the format uri specify is not present

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_dag25.c

    rc0dba7a r91b72d3  
    9898pthread_mutex_t open_dag_mutex;
    9999struct dag_dev_t *open_dags = NULL;
     100
     101static void dag_probe_filename(const char *filename)
     102{
     103        struct stat statbuf;
     104        /* Can we stat the file? */
     105        if (stat(filename, &statbuf) != 0) {
     106                return 0;
     107        }
     108        /* Is it a character device? */
     109        if (!S_ISCHR(statbuf.st_mode)) {
     110                return 0;
     111        }
     112        /* Yeah, it's probably us. */
     113        return 1;
     114}
    100115
    101116static void dag_init_format_data(libtrace_t *libtrace) {
     
    572587        "$Id$",
    573588        TRACE_FORMAT_ERF,
     589        dag_probe_filename,             /* probe filename */
     590        NULL,                           /* probe magic */
    574591        dag_init_input,                 /* init_input */
    575592        dag_config_input,               /* config_input */
Note: See TracChangeset for help on using the changeset viewer.