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
92
93
94
95
96
97


98
99
100
101
102
103
104
...
127
128
129
130
131
132
133
134

135
136
137
138
139
140
141
142
143

144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# Install exit handler to cleanup
rename exit _exit
proc exit args {
	cleanup
	_exit {*}$args
}



# Run tcpdump
set exit 1
set npf_failed 0
if {[catch {
	## Create directory
	file delete -force -- $dstdir
	file mkdir $dstdir
................................................................................
			error "npf did not start"
		}
	} npf_err]} {
		set npf_failed 1
	}

	## Launch tcpdump with the apropriate parameters
	exec -- [file join $filesdir tcpdump.exe] {*}$argv >&@ stdout


	set exit 0
} err]} {
	if {$npf_failed} {
		puts "NPF Failed: $npf_err"
	}

	puts "Failed: $err"


	set exit 1
}


# Cleanup
catch {
	::twapi::stop_service npf
}
catch {
	::twapi::delete_service npf
}

catch {
	file delete -force -- $dstdir
}

# Terminate
exit $exit







>
>







 







|
>





<
<
|
|
>



<
<
<
<
<
<
<
<
<
<
<
<
<


91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
...
129
130
131
132
133
134
135
136
137
138
139
140
141
142


143
144
145
146
147
148













149
150
# Install exit handler to cleanup
rename exit _exit
proc exit args {
	cleanup
	_exit {*}$args
}

twapi::set_console_control_handler exit

# Run tcpdump
set exit 1
set npf_failed 0
if {[catch {
	## Create directory
	file delete -force -- $dstdir
	file mkdir $dstdir
................................................................................
			error "npf did not start"
		}
	} npf_err]} {
		set npf_failed 1
	}

	## Launch tcpdump with the apropriate parameters
	set tcpdumpexe [file join $filesdir tcpdump.exe]
	exec -- $tcpdumpexe {*}$argv >&@ stdout

	set exit 0
} err]} {
	if {$npf_failed} {
		puts "NPF Failed: $npf_err"


		puts "Failed: $err"
	}

	set exit 1
}














# Terminate
exit $exit