Ticket #15906: catch_ping_fail.diff

File catch_ping_fail.diff, 1.0 KB (added by jmroot (Joshua Root), 16 years ago)

catch failure to spawn ping

  • src/port1.0/portfetch.tcl

     
    361361                }
    362362            }
    363363            if { ![info exists seen($host)] } {
    364                 set seen($host) yes
    365                 lappend hosts $host
    366                 ui_debug "Pinging $host..."
    367                 set fds($host) [open "|ping -noq -c3 -t3 $host | grep round-trip | cut -d / -f 5"]
     364                if {[catch {set fds($host) [open "|ping -noq -c3 -t3 $host | grep round-trip | cut -d / -f 5"]}]} {
     365                    ui_debug "Spawning ping for $host failed"
     366                    # will end up after all hosts that were pinged OK but before those that didn't respond
     367                    set pingtimes($host) 5000
     368                } else {
     369                    ui_debug "Pinging $host..."
     370                    set seen($host) yes
     371                    lappend hosts $host
     372                }
    368373            }
    369374        }
    370375