summaryrefslogtreecommitdiffstats
path: root/src/core/image.c
diff options
context:
space:
mode:
authorMichael Brown2008-07-08 04:15:02 +0200
committerMichael Brown2008-07-08 04:15:02 +0200
commit4f2861a3767700f3acb6320b10a67ea983f9ba0c (patch)
treecdc4f78253d8c011d5fb28343f7c86ceaaeb8ad2 /src/core/image.c
parent[image] Clear LOADED flag on all other images when loading a new image (diff)
downloadipxe-4f2861a3767700f3acb6320b10a67ea983f9ba0c.tar.gz
ipxe-4f2861a3767700f3acb6320b10a67ea983f9ba0c.tar.xz
ipxe-4f2861a3767700f3acb6320b10a67ea983f9ba0c.zip
[image] Revert "clear LOADED flag" patch
Clearing the LOADED flag actually prevents users from doing clever things such as loading an image, then loading a patch image, then executing the first image. (image_exec() checks for IMAGE_LOADED, so this sequence of operations will fail if the LOADED flag gets cleared.) This reverts commit 14c080020fb37cb34fe74213393f47bd2ad8b9bc.
Diffstat (limited to 'src/core/image.c')
-rw-r--r--src/core/image.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/core/image.c b/src/core/image.c
index d896be0e..440a68c9 100644
--- a/src/core/image.c
+++ b/src/core/image.c
@@ -156,7 +156,7 @@ void unregister_image ( struct image *image ) {
struct image * find_image ( const char *name ) {
struct image *image;
- for_each_image ( image ) {
+ list_for_each_entry ( image, &images, list ) {
if ( strcmp ( image->name, name ) == 0 )
return image;
}
@@ -172,21 +172,12 @@ struct image * find_image ( const char *name ) {
* @ret rc Return status code
*/
static int image_load_type ( struct image *image, struct image_type *type ) {
- struct image *tmp_image;
int rc;
/* Check image is actually loadable */
if ( ! type->load )
return -ENOEXEC;
- /* Clear the loaded flag on all images; loading this image
- * will invalidate any previous loads. (Even if loading
- * fails, the previously loaded image may still have been
- * partially overwritten.)
- */
- for_each_image ( tmp_image )
- tmp_image->flags &= ~IMAGE_LOADED;
-
/* Try the image loader */
if ( ( rc = type->load ( image ) ) != 0 ) {
DBGC ( image, "IMAGE %p could not load as %s: %s\n",