Home
redesign timer - bsleep - Unnamed repository; edit this file 'description' to name the repository. DIR Log DIR Files DIR Refs DIR README DIR LICENSE --- DIR commit 547be05462b5b0dc09a9c0f778f2887de0320a05 DIR parent 34d8a2829e40b14f76b6b212cda8e1dada80b1b0 HTML Author: kroovy <me@kroovy.de> Date: Fri, 21 Feb 2025 01:44:13 +0100 redesign timer Diffstat: M bsleep.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- DIR diff --git a/bsleep.c b/bsleep.c @@ -25,13 +25,12 @@ main(void) case 0: /* child */ for (i=1;;i++) { - printf("%d ", i); fflush(stdout); + printf(" press 'b' to interrupt: %ds\r", i); fflush(stdout); sleep(1); } exit(EXIT_SUCCESS); default: /* parent */ - printf("Child is PID %jd\n", (intmax_t) pid); system("/bin/stty raw"); while ((in = getchar()) != 'b') { printf("%c ", in);