Permalink
Browse files

Gracefully handle setting the default entry with the direct method wh…

…en no grubenv was found
  • Loading branch information...
1 parent 9ea522f commit b5bb1685f5cc8466150e45783b01346a23bb5684 David Mohr committed May 17, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/gchd-direct.c
View
@@ -112,9 +112,11 @@ set_default_entry (Gchd * gchd, gchar * entry, GError **error)
gboolean b;
gchar * env_filename;
+ r = 0;
env_filename = gchd_get_grub_file (gchd, "grubenv", error);
- r = grub_envblk_set (priv->env, default_key, entry);
+ if (env_filename)
+ r = grub_envblk_set (priv->env, default_key, entry);
if (!r)
{

0 comments on commit b5bb168

Please sign in to comment.