summaryrefslogtreecommitdiff
path: root/env
diff options
context:
space:
mode:
Diffstat (limited to 'env')
-rw-r--r--env/env.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/env/env.c b/env/env.c
index 3795dbc24e..dad6841e3c 100644
--- a/env/env.c
+++ b/env/env.c
@@ -191,16 +191,16 @@ int env_load(void)
int env_save(void)
{
struct env_driver *drv;
- int prio;
- for (prio = 0; (drv = env_driver_lookup(ENVOP_SAVE, prio)); prio++) {
+ drv = env_driver_lookup(ENVOP_SAVE, 0);
+ if (drv) {
int ret;
if (!drv->save)
- continue;
+ return -ENODEV;
if (!env_has_inited(drv->location))
- continue;
+ return -EPERM;
printf("Saving Environment to %s... ", drv->name);
ret = drv->save();