1
0
mirror of https://github.com/abakh/nbsdgames.git synced 2024-12-04 14:46:22 -05:00

oops some typos in usleep()

This commit is contained in:
Jens Staal 2020-06-14 07:20:44 +02:00
parent 5b46b348c1
commit e600887248
3 changed files with 12 additions and 12 deletions

View File

@ -17,11 +17,11 @@
#ifdef Plan9
int usleep(long usec) {
int seconds = usec/1000000;
long nano = usec*1000 - seconds*1000000;
int second = usec/1000000;
long nano = usec*1000 - second*1000000;
struct timespec sleepy = {0};
sleepy.ts_sec = second;
sleepy.ts_nsec = nano;
sleepy.tv_sec = second;
sleepy.tv_nsec = nano;
nanosleep(&sleepy, (struct timespec *) NULL);
return 0;
}

View File

@ -29,11 +29,11 @@ compile with -lncurses
#define len 10
#define wid 40
int usleep(long usec) {
int seconds = usec/1000000;
long nano = usec*1000 - seconds*1000000;
int second = usec/1000000;
long nano = usec*1000 - second*1000000;
struct timespec sleepy = {0};
sleepy.ts_sec = second;
sleepy.ts_nsec = nano;
sleepy.tv_sec = second;
sleepy.tv_nsec = nano;
nanosleep(&sleepy, (struct timespec *) NULL);
return 0;
}

View File

@ -27,11 +27,11 @@ compile with -lncurses
#define len 10
#define wid 40
int usleep(long usec) {
int seconds = usec/1000000;
long nano = usec*1000 - seconds*1000000;
int second = usec/1000000;
long nano = usec*1000 - second*1000000;
struct timespec sleepy = {0};
sleepy.ts_sec = second;
sleepy.ts_nsec = nano;
sleepy.tv_sec = second;
sleepy.tv_nsec = nano;
nanosleep(&sleepy, (struct timespec *) NULL);
return 0;
}