[openfirmware] [commit] r3491 - ofw/inet

repository service svn at openfirmware.info
Thu Dec 13 01:27:26 CET 2012


Author: wmb
Date: Thu Dec 13 01:27:26 2012
New Revision: 3491
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3491

Log:
Ping utility - clean up properly (close network driver) if set-host aborts due to an unresolvable hostname.

Modified:
   ofw/inet/ping.fth

Modified: ofw/inet/ping.fth
==============================================================================
--- ofw/inet/ping.fth	Thu Dec 13 01:26:17 2012	(r3490)
+++ ofw/inet/ping.fth	Thu Dec 13 01:27:26 2012	(r3491)
@@ -246,7 +246,10 @@
 ;
 
 : $ping  ( ip$ -- )
-   open-net  " $set-host" $call-net
+   open-net
+   " $set-host" ['] $call-net catch  ?dup  if  ( x x errno )
+      .error 2drop  close-net  exit
+   then
    /ping-max " allocate-ip" $call-net to ping-packet
    try-pings
    ping-packet /ping-max " free-ip" $call-net



More information about the openfirmware mailing list