Changes in / [08f5060:cf686e1]


Ignore:
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • README

    r0ae5feb ra7c8f4a  
    1 libtrace 3.0.20
     1libtrace 3.0.21
    22
    33---------------------------------------------------------------------------
     
    2121Further information about libtrace see
    2222http://research.wand.net.nz/software/libtrace.php
    23 Bugs should be reported in trac at http://www.wand.net.nz/trac/libtrace
     23
     24Bugs should be reported by either emailing contact@wand.net.nz or filing
     25an issue at https://github.com/wanduow/libtrace
    2426
    2527It is licensed under the GNU General Public License (GPL) version 2. Please
     
    2729
    2830A detailed ChangeLog can be found on the libtrace wiki:
    29 https://secure.wand.net.nz/trac/libtrace/wiki/ChangeLog
     31https://github.com/wanduow/libtrace/wiki/ChangeLog
    3032
    3133Documentation, usage instructions and a detailed tutorial can also found
  • configure.in

    rcd8efa6 ra7c8f4a  
    44# and in the README
    55
    6 AC_INIT([libtrace],[3.0.20],[contact@wand.net.nz],[libtrace])
     6AC_INIT([libtrace],[3.0.21],[contact@wand.net.nz],[libtrace])
    77
    88LIBTRACE_MAJOR=3
    99LIBTRACE_MID=0
    10 LIBTRACE_MINOR=20
     10LIBTRACE_MINOR=21
    1111
    1212# OpenSolaris hides libraries like libncurses in /usr/gnu/lib, which is not
  • lib/format_linux.c

    rc70f59f r63af502  
    893893        int snaplen;
    894894        uint32_t flags = 0;
     895        fd_set readfds;
     896        struct timeval tout;
     897        int ret;
    895898       
    896899        if (!packet->buffer || packet->buf_control == TRACE_CTRL_EXTERNAL) {
     
    928931        iovec.iov_len = snaplen;
    929932
    930         hdr->wirelen = recvmsg(FORMAT(libtrace->format_data)->fd, &msghdr, MSG_TRUNC);
     933        /* Use select to allow us to time out occasionally to check if someone
     934         * has hit Ctrl-C or otherwise wants us to stop reading and return
     935         * so they can exit their program.
     936         */
     937
     938        while (1) {
     939                tout.tv_sec = 0;
     940                tout.tv_usec = 500000;
     941                FD_ZERO(&readfds);
     942                FD_SET(FORMAT(libtrace->format_data)->fd, &readfds);
     943
     944                ret = select(FORMAT(libtrace->format_data)->fd + 1, &readfds,
     945                                NULL, NULL, &tout);
     946                if (ret < 0 && errno != EINTR) {
     947                        trace_set_err(libtrace, errno, "select");
     948                        return -1;
     949                } else if (ret < 0) {
     950                        continue;
     951                }
     952               
     953                if (FD_ISSET(FORMAT(libtrace->format_data)->fd, &readfds)) {
     954                        /* There's something available for us to read */
     955                        break;
     956                }
     957
     958               
     959                /* If we get here, we timed out -- check if we should halt */
     960                if (libtrace_halt)
     961                        return 0;
     962        }
     963
     964        hdr->wirelen = recvmsg(FORMAT(libtrace->format_data)->fd, &msghdr, MSG_TRUNC);
    931965
    932966        if (hdr->wirelen==~0U) {
     
    10441078        assert((((unsigned long) header) & (pagesize - 1)) == 0);
    10451079
    1046         /* TP_STATUS_USER means that we can use the frame.
    1047          * When a slot does not have this flag set, the frame is not
    1048          * ready for consumption.
    1049          */
    1050         while (!(header->tp_status & TP_STATUS_USER)) {
     1080        while (1) {
    10511081                pollset.fd = FORMAT(libtrace->format_data)->fd;
    10521082                pollset.events = POLLIN;
    10531083                pollset.revents = 0;
    10541084                /* Wait for more data */
    1055                 ret = poll(&pollset, 1, -1);
     1085                ret = poll(&pollset, 1, 500);
    10561086                if (ret < 0) {
    10571087                        if (errno != EINTR)
    10581088                                trace_set_err(libtrace,errno,"poll()");
    10591089                        return -1;
    1060                 }
     1090                } else if (ret == 0) {
     1091                        /* Poll timed out - check if we should exit */
     1092                        if (libtrace_halt)
     1093                                return 0;
     1094                        continue;
     1095                }
     1096
     1097                /* TP_STATUS_USER means that we can use the frame.
     1098                 * When a slot does not have this flag set, the frame is not
     1099                 * ready for consumption.
     1100                 */
     1101                if (header->tp_status & TP_STATUS_USER)
     1102                        break;
    10611103        }
    10621104
Note: See TracChangeset for help on using the changeset viewer.