From 5ee37143af35add9a008e332582677b2dc8ce581 Mon Sep 17 00:00:00 2001 From: Anton Lydike Date: Thu, 26 Aug 2021 10:38:52 +0200 Subject: [PATCH] made example spawn program exit after child --- programs/README.md | 2 +- programs/spawn.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/README.md b/programs/README.md index ef084b3..d843b2c 100644 --- a/programs/README.md +++ b/programs/README.md @@ -2,7 +2,7 @@ Note that these programs are of poor quality. -* `simple.c` does some arithmetic in a loop, occasionally prints something rather random (the sequence goes `90,90,90,2386,2386,ae86,520c,1cbde,...`) +* `simple.c` does some arithmetic in a loop, occasionally prints something rather random (the sequence goes `90,90,90,2386,2386,ae86,520c,1cbdc,1cbde...`) * `spawn.c` this thing spawn a new thread and exits when the thread overwrites a value. ## Compiling diff --git a/programs/spawn.c b/programs/spawn.c index b2f4721..a45d617 100644 --- a/programs/spawn.c +++ b/programs/spawn.c @@ -34,7 +34,7 @@ int thread(void* args) dbgln(buff, (int) (end - buff)); - // *((int*) args) = 0; + *((int*) args) = 0; return arg; }