Browse Source

Fix prototype of sleep() and move it to unistd.h

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
637a891264
3 changed files with 5 additions and 3 deletions
  1. 3
    2
      src/core/misc.c
  2. 1
    1
      src/include/etherboot.h
  3. 1
    0
      src/include/unistd.h

+ 3
- 2
src/core/misc.c View File

@@ -75,12 +75,13 @@ int32_t random(void)
75 75
 /**************************************************************************
76 76
 SLEEP
77 77
 **************************************************************************/
78
-void sleep(int secs)
78
+unsigned int sleep(unsigned int secs)
79 79
 {
80 80
 	unsigned long tmo;
81 81
 
82 82
 	for (tmo = currticks()+secs*TICKS_PER_SEC; currticks() < tmo; ) {
83 83
 	}
84
+	return 0;
84 85
 }
85 86
 
86 87
 /**************************************************************************
@@ -89,7 +90,7 @@ INTERRUPTIBLE SLEEP
89 90
 void interruptible_sleep(int secs)
90 91
 {
91 92
 	printf("<sleep>\n");
92
-	return sleep(secs);
93
+	sleep(secs);
93 94
 }
94 95
 
95 96
 /**************************************************************************

+ 1
- 1
src/include/etherboot.h View File

@@ -9,6 +9,7 @@
9 9
 #include "compiler.h"
10 10
 #include "stddef.h"
11 11
 #include "stdint.h"
12
+#include <unistd.h>
12 13
 
13 14
 
14 15
 /*
@@ -220,7 +221,6 @@ extern int load_block P((unsigned char *, unsigned int, unsigned int, int ));
220 221
 
221 222
 /* misc.c */
222 223
 extern void twiddle P((void));
223
-extern void sleep P((int secs));
224 224
 extern void interruptible_sleep P((int secs));
225 225
 extern int strcasecmp P((const char *a, const char *b));
226 226
 extern char *substr P((const char *a, const char *b));

+ 1
- 0
src/include/unistd.h View File

@@ -4,6 +4,7 @@
4 4
 #include <stddef.h>
5 5
 #include <stdarg.h>
6 6
 
7
+extern unsigned int sleep ( unsigned int seconds );
7 8
 extern int execv ( const char *command, char * const argv[] );
8 9
 
9 10
 /**

Loading…
Cancel
Save