~ubuntu-branches/ubuntu/wily/grub2/wily-proposed

« back to all changes in this revision

Viewing changes to util/getroot.c

  • Committer: Bazaar Package Importer
  • Author(s): Felix Zielcke, Robert Millan, Felix Zielcke
  • Date: 2010-01-26 19:26:25 UTC
  • mfrom: (1.13.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100126192625-coq6czap2ofjollf
Tags: 1.98~20100126-1
* New Bazaar snapshot.
  - Includes mipsel-yeeloong port.

[ Robert Millan ]
* config.in: Lower priority of grub2/linux_cmdline_default.

[ Felix Zielcke ]
* Drop `CFLAGS=-O0' workaround on powerpc. Should be fixed correctly now.
* Ship grub-bin2h and grub-script-check in grub-common.
* Terminate NEWS.Debian with a blank line like lintian would suggest
  if that check would be working correctly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
  saved_cwd = xgetcwd ();
116
116
 
117
117
  if (chdir (dir) < 0)
118
 
    grub_util_error ("Cannot change directory to `%s'", dir);
 
118
    grub_util_error ("cannot change directory to `%s'", dir);
119
119
 
120
120
  abs_dir = xgetcwd ();
121
121
  strip_extra_slashes (abs_dir);
122
122
  prev_dir = xstrdup (abs_dir);
123
123
 
124
124
  if (stat (".", &prev_st) < 0)
125
 
    grub_util_error ("Cannot stat `%s'", dir);
 
125
    grub_util_error ("cannot stat `%s'", dir);
126
126
 
127
127
  if (! S_ISDIR (prev_st.st_mode))
128
128
    grub_util_error ("`%s' is not a directory", dir);
130
130
  while (1)
131
131
    {
132
132
      if (chdir ("..") < 0)
133
 
        grub_util_error ("Cannot change directory to the parent");
 
133
        grub_util_error ("cannot change directory to the parent");
134
134
 
135
135
      if (stat (".", &st) < 0)
136
 
        grub_util_error ("Cannot stat current directory");
 
136
        grub_util_error ("cannot stat current directory");
137
137
 
138
138
      if (! S_ISDIR (st.st_mode))
139
 
        grub_util_error ("Current directory is not a directory???");
 
139
        grub_util_error ("current directory is not a directory???");
140
140
 
141
141
      if (prev_st.st_dev != st.st_dev || prev_st.st_ino == st.st_ino)
142
142
        break;
153
153
  strip_extra_slashes (prefix);
154
154
 
155
155
  if (chdir (saved_cwd) < 0)
156
 
    grub_util_error ("Cannot change directory to `%s'", dir);
 
156
    grub_util_error ("cannot change directory to `%s'", dir);
157
157
 
158
158
#ifdef __CYGWIN__
159
159
  if (st.st_dev != (DEV_CYGDRIVE_MAJOR << 16))
236
236
          if (res)
237
237
            {
238
238
              if (chdir (saved_cwd) < 0)
239
 
                grub_util_error ("Cannot restore the original directory");
 
239
                grub_util_error ("cannot restore the original directory");
240
240
 
241
241
              free (saved_cwd);
242
242
              closedir (dp);
279
279
                continue;
280
280
 
281
281
          if (chdir (saved_cwd) < 0)
282
 
            grub_util_error ("Cannot restore the original directory");
 
282
            grub_util_error ("cannot restore the original directory");
283
283
 
284
284
          free (saved_cwd);
285
285
          closedir (dp);
288
288
    }
289
289
 
290
290
  if (chdir (saved_cwd) < 0)
291
 
    grub_util_error ("Cannot restore the original directory");
 
291
    grub_util_error ("cannot restore the original directory");
292
292
 
293
293
  free (saved_cwd);
294
294
  closedir (dp);
445
445
  struct stat st;
446
446
 
447
447
  if (stat (dir, &st) < 0)
448
 
    grub_util_error ("Cannot stat `%s'", dir);
 
448
    grub_util_error ("cannot stat `%s'", dir);
449
449
 
450
450
#ifdef __CYGWIN__
451
451
  /* Cygwin specific function.  */
591
591
          free (p);
592
592
        }
593
593
      else
594
 
        grub_util_error ("Unknown kind of RAID device `%s'", os_dev);
 
594
        grub_util_error ("unknown kind of RAID device `%s'", os_dev);
595
595
 
596
596
      break;
597
597
 
608
608
  struct stat st;
609
609
 
610
610
  if (stat (blk_dev, &st) < 0)
611
 
    grub_util_error ("Cannot stat `%s'", blk_dev);
 
611
    grub_util_error ("cannot stat `%s'", blk_dev);
612
612
 
613
613
  if (S_ISBLK (st.st_mode))
614
614
    return (blk_dev);
622
622
  struct stat st;
623
623
 
624
624
  if (stat (blk_dev, &st) < 0)
625
 
    grub_util_error ("Cannot stat `%s'", blk_dev);
 
625
    grub_util_error ("cannot stat `%s'", blk_dev);
626
626
 
627
627
  if (S_ISCHR (st.st_mode))
628
628
    return (blk_dev);