summaryrefslogtreecommitdiffstats
path: root/src/core/main.c
diff options
context:
space:
mode:
authorMichael Brown2011-03-07 18:10:24 +0100
committerMichael Brown2011-03-07 20:53:58 +0100
commit7752541bb7c1c338c2390cf6e4f0c035a13515d9 (patch)
treef10088c14821d62141867a5c415923755561fa65 /src/core/main.c
parent[script] Add "prompt" command (diff)
downloadipxe-7752541bb7c1c338c2390cf6e4f0c035a13515d9.tar.gz
ipxe-7752541bb7c1c338c2390cf6e4f0c035a13515d9.tar.xz
ipxe-7752541bb7c1c338c2390cf6e4f0c035a13515d9.zip
[image] Use list_first_entry() to clarify logic in main()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 35f31c2c..7d411d6a 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -88,11 +88,8 @@ __asmcall int main ( void ) {
* booting fails for any reason, offer a second chance
* to enter the shell for diagnostics.
*/
- if ( have_images() ) {
- for_each_image ( image ) {
- image_exec ( image );
- break;
- }
+ if ( ( image = first_image() ) != NULL ) {
+ image_exec ( image );
} else {
autoboot();
}