Check-in [5dcad0ff2a]
Overview
Comment:Updated to register console handler, which seems to be enough to cause cleanup routines to usually run
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5dcad0ff2a92e2cd3f9b06ae53e1137cc92d579f
User & Date: rkeene on 2014-01-25 08:40:13
Other Links: manifest | tags
Context
2014-01-25
13:05
Updated to produce higher quality icons check-in: bbce7dce6b user: rkeene tags: trunk
08:40
Updated to register console handler, which seems to be enough to cause cleanup routines to usually run check-in: 5dcad0ff2a user: rkeene tags: trunk
08:23
Added icon check-in: 2af245b1db 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
# 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







>
>







91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# 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
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
			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







|
>





<
<
|
|
>



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


129
130
131
132
133
134
135
136
137
138
139
140
141
142


143
144
145
146
147
148













149
150
			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