|
@@ -36,10 +36,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
36
|
36
|
#include <ipxe/command.h>
|
37
|
37
|
#include <ipxe/parseopt.h>
|
38
|
38
|
#include <ipxe/settings.h>
|
39
|
|
-#include <ipxe/console.h>
|
40
|
|
-#include <ipxe/keys.h>
|
41
|
|
-#include <ipxe/process.h>
|
42
|
|
-#include <ipxe/nap.h>
|
43
|
39
|
#include <ipxe/shell.h>
|
44
|
40
|
|
45
|
41
|
/** @file
|
|
@@ -573,8 +569,6 @@ static struct command_descriptor sleep_cmd =
|
573
|
569
|
static int sleep_exec ( int argc, char **argv ) {
|
574
|
570
|
struct sleep_options opts;
|
575
|
571
|
unsigned int seconds;
|
576
|
|
- unsigned long start;
|
577
|
|
- unsigned long delay;
|
578
|
572
|
int rc;
|
579
|
573
|
|
580
|
574
|
/* Parse options */
|
|
@@ -586,14 +580,8 @@ static int sleep_exec ( int argc, char **argv ) {
|
586
|
580
|
return rc;
|
587
|
581
|
|
588
|
582
|
/* Delay for specified number of seconds */
|
589
|
|
- start = currticks();
|
590
|
|
- delay = ( seconds * TICKS_PER_SEC );
|
591
|
|
- while ( ( currticks() - start ) <= delay ) {
|
592
|
|
- step();
|
593
|
|
- if ( iskey() && ( getchar() == CTRL_C ) )
|
594
|
|
- return -ECANCELED;
|
595
|
|
- cpu_nap();
|
596
|
|
- }
|
|
583
|
+ if ( sleep ( seconds ) != 0 )
|
|
584
|
+ return -ECANCELED;
|
597
|
585
|
|
598
|
586
|
return 0;
|
599
|
587
|
}
|