Browse Source

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

tags/v0.9.3
Michael Brown 18 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
 /**************************************************************************
75
 /**************************************************************************
76
 SLEEP
76
 SLEEP
77
 **************************************************************************/
77
 **************************************************************************/
78
-void sleep(int secs)
78
+unsigned int sleep(unsigned int secs)
79
 {
79
 {
80
 	unsigned long tmo;
80
 	unsigned long tmo;
81
 
81
 
82
 	for (tmo = currticks()+secs*TICKS_PER_SEC; currticks() < tmo; ) {
82
 	for (tmo = currticks()+secs*TICKS_PER_SEC; currticks() < tmo; ) {
83
 	}
83
 	}
84
+	return 0;
84
 }
85
 }
85
 
86
 
86
 /**************************************************************************
87
 /**************************************************************************
89
 void interruptible_sleep(int secs)
90
 void interruptible_sleep(int secs)
90
 {
91
 {
91
 	printf("<sleep>\n");
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
 #include "compiler.h"
9
 #include "compiler.h"
10
 #include "stddef.h"
10
 #include "stddef.h"
11
 #include "stdint.h"
11
 #include "stdint.h"
12
+#include <unistd.h>
12
 
13
 
13
 
14
 
14
 /*
15
 /*
220
 
221
 
221
 /* misc.c */
222
 /* misc.c */
222
 extern void twiddle P((void));
223
 extern void twiddle P((void));
223
-extern void sleep P((int secs));
224
 extern void interruptible_sleep P((int secs));
224
 extern void interruptible_sleep P((int secs));
225
 extern int strcasecmp P((const char *a, const char *b));
225
 extern int strcasecmp P((const char *a, const char *b));
226
 extern char *substr P((const char *a, const char *b));
226
 extern char *substr P((const char *a, const char *b));

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

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

Loading…
Cancel
Save