aboutsummaryrefslogtreecommitdiff
path: root/src/usr
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2010-11-21 16:39:36 +0000
committerMichael Brown <mcb30@ipxe.org>2010-11-21 20:38:39 +0000
commit17b337d4a8ae0a355a8e61e967f5015907590e9e (patch)
treefce8671e09fb9dabfcf3b2d7e2556dbb3aa86fa6 /src/usr
parent2877af3ff585065a3b43630cbfd30ccd4f8d65c9 (diff)
downloadipxe-17b337d4a8ae0a355a8e61e967f5015907590e9e.zip
ipxe-17b337d4a8ae0a355a8e61e967f5015907590e9e.tar.gz
ipxe-17b337d4a8ae0a355a8e61e967f5015907590e9e.tar.bz2
[autoboot] Use generic option-parsing library
Total saving: 32 bytes. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/usr')
-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 d87e362..c7492ea 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;
}