From e600887248f013101b0e9f6fb47da09f5812d304 Mon Sep 17 00:00:00 2001 From: Jens Staal Date: Sun, 14 Jun 2020 07:20:44 +0200 Subject: [PATCH] oops some typos in usleep() --- sources/fisher.c | 8 ++++---- sources/miketron.c | 8 ++++---- sources/muncher.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sources/fisher.c b/sources/fisher.c index 795c30b..68e4c96 100644 --- a/sources/fisher.c +++ b/sources/fisher.c @@ -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; } diff --git a/sources/miketron.c b/sources/miketron.c index fcd9146..099677b 100644 --- a/sources/miketron.c +++ b/sources/miketron.c @@ -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; } diff --git a/sources/muncher.c b/sources/muncher.c index 2c2a35f..1a347ab 100644 --- a/sources/muncher.c +++ b/sources/muncher.c @@ -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; }