~ubuntu-branches/ubuntu/trusty/grub2/trusty-updates

« back to all changes in this revision

Viewing changes to grub-core/commands/sleep.c

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-09-13 18:02:04 UTC
  • mfrom: (1.17.15 upstream)
  • mto: (17.6.27 experimental)
  • mto: This revision was merged to the branch mainline in revision 145.
  • Revision ID: package-import@ubuntu.com-20120913180204-mojnmocbimlom4im
Tags: upstream-2.00
ImportĀ upstreamĀ versionĀ 2.00

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
static const struct grub_arg_option options[] =
31
31
  {
32
32
    {"verbose", 'v', 0, N_("Verbose countdown."), 0, 0},
33
 
    {"interruptible", 'i', 0, N_("Interruptible with ESC."), 0, 0},
 
33
    {"interruptible", 'i', 0, N_("Allow to interrupt with ESC."), 0, 0},
34
34
    {0, 0, 0, 0, 0, 0}
35
35
  };
36
36
 
43
43
  /* NOTE: Do not remove the trailing space characters.
44
44
     They are required to clear the line.  */
45
45
  grub_printf ("%d    ", n);
 
46
  grub_refresh ();
46
47
}
47
48
 
48
49
/* Based on grub_millisleep() from kern/generic/millisleep.c.  */
54
55
  start = grub_get_time_ms ();
55
56
 
56
57
  while (grub_get_time_ms () - start < ms)
57
 
    if (grub_checkkey () >= 0 && grub_getkey () == GRUB_TERM_ESC)
 
58
    if (grub_getkey_noblock () == GRUB_TERM_ESC)
58
59
      return 1;
59
60
 
60
61
  return 0;
67
68
  int n;
68
69
 
69
70
  if (argc != 1)
70
 
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "missing operand");
 
71
    return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
71
72
 
72
73
  n = grub_strtoul (args[0], 0, 10);
73
74