Check-in [1384012f07]
Overview
SHA1:1384012f070f975065055da1a267ba5826e15b01
Date: 2014-01-25 06:57:06
User: rkeene
Comment:Updated to cleanup at any exit point
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2014-01-25
07:06
[e2aa9dcf13] Made smaller Tcl error (user: rkeene, tags: trunk)
06:57
[1384012f07] Updated to cleanup at any exit point (user: rkeene, tags: trunk)
06:40
[eda3d468e1] Cleaned up (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