Check-in [b357796ad5]
Overview
Comment:Updated to be more careful about closing files
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:b357796ad55a4ce3989c07efb91c02adc66b7772
User & Date: rkeene on 2015-10-14 17:47:51
Other Links: manifest | tags
Context
2015-10-14
17:48
Updated to set resource limits for number of open files at startup, if possible check-in: ea36882e15 user: rkeene tags: trunk
17:47
Updated to be more careful about closing files check-in: b357796ad5 user: rkeene tags: trunk
17:47
Changed mount options to remove "direct_io", which breaks mmap and performed additional cleanups check-in: 1c47ca9097 user: rkeene tags: trunk
Changes

Modified appfsd.tcl from [e7e131fd9c] to [9efbb291d1].

   337    337   		}
   338    338   
   339    339   		if {![_verifySignatureAndCertificate $hostname $indexhashcert $indexhashsig $indexhash]} {
   340    340   			return -code error "Invalid signature or certificate from $hostname"
   341    341   		}
   342    342   
   343    343   		set file [download $hostname $indexhash]
   344         -		set fd [open $file]
   345         -		set data [read $fd]
          344  +		catch {
          345  +			set fd [open $file]
          346  +		}
          347  +
          348  +		if {![info exists fd]} {
          349  +			return -code error "Unable to download or open $file"
          350  +		}
          351  +
          352  +		unset -nocomplain data
          353  +		catch {
          354  +			set data [read $fd]
          355  +		}
          356  +
   346    357   		close $fd
   347    358   
   348    359   		set curr_packages [list]
   349    360   		foreach line [split $data "\n"] {
   350    361   			set line [string trim $line]
   351    362   
   352    363   			if {[string match "*/*" $line]} {
................................................................................
   420    431   		}
   421    432   
   422    433   		if {![_isHash $package_sha1]} {
   423    434   			return FAIL
   424    435   		}
   425    436   
   426    437   		set file [download $hostname $package_sha1]
   427         -		set fd [open $file]
   428         -		set pkgdata [read $fd]
          438  +
          439  +		catch {
          440  +			set fd [open $file]
          441  +		}
          442  +
          443  +		if {![info exists fd]} {
          444  +			return -code error "Unable to download or open $file"
          445  +		}
          446  +
          447  +		catch {
          448  +			set pkgdata [read $fd]
          449  +		}
          450  +
   429    451   		close $fd
   430    452   
   431    453   		db transaction {
   432    454   			foreach line [split $pkgdata "\n"] {
   433    455   				set line [string trim $line]
   434    456   
   435    457   				if {$line == ""} {