Check-in [5dcad0ff2a]
Overview
SHA1:5dcad0ff2a92e2cd3f9b06ae53e1137cc92d579f
Date: 2014-01-25 08:40:13
User: rkeene
Comment:Updated to register console handler, which seems to be enough to cause cleanup routines to usually run
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2014-01-25
13:05
[bbce7dce6b] Updated to produce higher quality icons (user: rkeene, tags: trunk)
08:40
[5dcad0ff2a] Updated to register console handler, which seems to be enough to cause cleanup routines to usually run (user: rkeene, tags: trunk)
08:23
[2af245b1db] Added icon (user: rkeene, tags: trunk)
Changes

Modified main.tcl from [13c7187af2] to [cfaf5bf4e4].

    91     91   # Install exit handler to cleanup
    92     92   rename exit _exit
    93     93   proc exit args {
    94     94   	cleanup
    95     95   	_exit {*}$args
    96     96   }
    97     97   
           98  +twapi::set_console_control_handler exit
           99  +
    98    100   # Run tcpdump
    99    101   set exit 1
   100    102   set npf_failed 0
   101    103   if {[catch {
   102    104   	## Create directory
   103    105   	file delete -force -- $dstdir
   104    106   	file mkdir $dstdir
................................................................................
   127    129   			error "npf did not start"
   128    130   		}
   129    131   	} npf_err]} {
   130    132   		set npf_failed 1
   131    133   	}
   132    134   
   133    135   	## Launch tcpdump with the apropriate parameters
   134         -	exec -- [file join $filesdir tcpdump.exe] {*}$argv >&@ stdout
          136  +	set tcpdumpexe [file join $filesdir tcpdump.exe]
          137  +	exec -- $tcpdumpexe {*}$argv >&@ stdout
   135    138   
   136    139   	set exit 0
   137    140   } err]} {
   138    141   	if {$npf_failed} {
   139    142   		puts "NPF Failed: $npf_err"
          143  +		puts "Failed: $err"
   140    144   	}
   141    145   
   142         -	puts "Failed: $err"
   143         -
   144    146   	set exit 1
   145    147   }
   146    148   
   147         -
   148         -# Cleanup
   149         -catch {
   150         -	::twapi::stop_service npf
   151         -}
   152         -catch {
   153         -	::twapi::delete_service npf
   154         -}
   155         -
   156         -catch {
   157         -	file delete -force -- $dstdir
   158         -}
   159         -
   160    149   # Terminate
   161    150   exit $exit