~ubuntu-branches/ubuntu/jaunty/grub2/jaunty-proposed

« back to all changes in this revision

Viewing changes to kern/env.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Millan
  • Date: 2008-01-28 00:01:11 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20080128000111-qolpe0u4qkf0xccc
Tags: 1.95+20080128-1
* New CVS snapshot.
  - Fixes bogus CLAIM problems on Apple firmware.  (Closes: #449135, #422729)
  - grub-probe performs sanity checks to make sure our filesystem drivers
    are usable.  (Closes: #462449)
  - patches/disable_ata.diff: Remove.  ATA module isn't auto-loaded in
    rescue floppies now.
  - patches/disable_xfs.diff: Remove.  See above (about grub-probe).
* Bring back grub-emu; it can help a lot with debugging feedback.
  - control
  - rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* env.c - Environment variables */
2
2
/*
3
3
 *  GRUB  --  GRand Unified Bootloader
4
 
 *  Copyright (C) 2003,2005,2006,2007  Free Software Foundation, Inc.
 
4
 *  Copyright (C) 2003,2005,2006,2007,2008  Free Software Foundation, Inc.
5
5
 *
6
6
 *  GRUB is free software: you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
53
53
{
54
54
  unsigned int i = 0;
55
55
 
56
 
  /* XXX: This can be done much more effecient.  */
 
56
  /* XXX: This can be done much more efficiently.  */
57
57
  while (*s)
58
58
    i += 5 * *(s++);
59
59
 
96
96
      for (var = context->prev->vars[i]; var; var = var->next)
97
97
        {
98
98
          if (var->type == GRUB_ENV_VAR_GLOBAL)
99
 
            if (grub_env_set (var->name, var->value) != GRUB_ERR_NONE)
100
 
              {
101
 
                grub_env_context_close ();
102
 
                return grub_errno;
103
 
              }
 
99
            {
 
100
              if (grub_env_set (var->name, var->value) != GRUB_ERR_NONE)
 
101
                {
 
102
                  grub_env_context_close ();
 
103
                  return grub_errno;
 
104
                }
 
105
              grub_register_variable_hook (var->name, var->read_hook, var->write_hook);
 
106
            }
104
107
        }
105
108
    }
106
109