Changeset 41816bf


Ignore:
Timestamp:
11/25/06 12:34:34 (14 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:
0a62bba
Parents:
7dd71f0
Message:

Cleanup on signal

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/tracesplit/tracesplit.c

    ra7282fb r41816bf  
    1010#include <string.h>
    1111#include <assert.h>
     12#include <signal.h>
    1213
    1314static char *strdupcat(char *str,char *app)
     
    3839        ,argv0);
    3940        exit(1);
     41}
     42
     43int done=0;
     44
     45void cleanup_signal(int sig)
     46{
     47        done=1;
    4048}
    4149
     
    121129        }
    122130
    123         while(1) {
     131        signal(SIGINT,&cleanup_signal);
     132        signal(SIGTERM,&cleanup_signal);
     133
     134        while(!done) {
    124135               
    125136                if (trace_read_packet(input,packet)<1) {
Note: See TracChangeset for help on using the changeset viewer.