summaryrefslogtreecommitdiffstats
path: root/src/usr/autoboot.c
diff options
context:
space:
mode:
authorMichael Brown2010-11-21 17:39:36 +0100
committerMichael Brown2010-11-21 21:38:39 +0100
commit17b337d4a8ae0a355a8e61e967f5015907590e9e (patch)
treefce8671e09fb9dabfcf3b2d7e2556dbb3aa86fa6 /src/usr/autoboot.c
parent[vlan] Use generic option-parsing library (diff)
downloadipxe-17b337d4a8ae0a355a8e61e967f5015907590e9e.tar.gz
ipxe-17b337d4a8ae0a355a8e61e967f5015907590e9e.tar.xz
ipxe-17b337d4a8ae0a355a8e61e967f5015907590e9e.zip
[autoboot] Use generic option-parsing library
Total saving: 32 bytes. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/usr/autoboot.c')
-rw-r--r--src/usr/autoboot.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c
index d87e3627..c7492ea7 100644
--- a/src/usr/autoboot.c
+++ b/src/usr/autoboot.c
@@ -293,22 +293,24 @@ static void close_all_netdevs ( void ) {
/**
* Boot the system
*/
-void autoboot ( void ) {
+int autoboot ( void ) {
struct net_device *boot_netdev;
struct net_device *netdev;
+ int rc = -ENODEV;
/* If we have an identifable boot device, try that first */
close_all_netdevs();
if ( ( boot_netdev = find_boot_netdev() ) )
- netboot ( boot_netdev );
+ rc = netboot ( boot_netdev );
/* If that fails, try booting from any of the other devices */
for_each_netdev ( netdev ) {
if ( netdev == boot_netdev )
continue;
close_all_netdevs();
- netboot ( netdev );
+ rc = netboot ( netdev );
}
printf ( "No more network devices\n" );
+ return rc;
}