Check-in [1384012f07]
Overview
Comment:Updated to cleanup at any exit point
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1384012f070f975065055da1a267ba5826e15b01
User & Date: rkeene on 2014-01-25 06:57:06
Other Links: manifest | tags
Context
2014-01-25
07:06
Made smaller Tcl error check-in: e2aa9dcf13 user: rkeene tags: trunk
06:57
Updated to cleanup at any exit point check-in: 1384012f07 user: rkeene tags: trunk
06:40
Cleaned up check-in: eda3d468e1 user: rkeene tags: trunk
Changes

Modified main.tcl from [2ed373a5f2] to [ddb6656dc1].

70
71
72
73
74
75
76




















77
78
79
80
81
82
83
for {set i 0} {$i < 20} {incr i} {
	append random_bin [format %c [expr {int(rand() * 256)}]]
}
binary scan $random_bin H* random

set srcdir [file join $::starkit::topdir files]
set dstdir [file join $tmpdir tcpdump-temp-$random]





















# Run tcpdump
set exit 1
set npf_failed 0
if {[catch {
	## Create directory
	file delete -force -- $dstdir







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
for {set i 0} {$i < 20} {incr i} {
	append random_bin [format %c [expr {int(rand() * 256)}]]
}
binary scan $random_bin H* random

set srcdir [file join $::starkit::topdir files]
set dstdir [file join $tmpdir tcpdump-temp-$random]

proc cleanup {} {
	# Cleanup
	catch {
		::twapi::stop_service npf
	}
	catch {
		::twapi::delete_service npf
	}
	catch {
		file delete -force -- $::dstdir
	}
}

# 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