From 5f0faa13c8e66706b867019ac7a1ebb1acd2d29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hillerstr=C3=B6m?= Date: Fri, 2 Oct 2020 16:11:10 +0100 Subject: [PATCH] minor code revision. --- code/unix2.links | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/code/unix2.links b/code/unix2.links index af00b24..6f82967 100644 --- a/code/unix2.links +++ b/code/unix2.links @@ -161,15 +161,20 @@ fun example4() { status(fun() { var parent = fork(); (if (parent) su(Alice) else su(Bob)); - echo(whoami () ^^ "> Hello "); + echo(whoami() ^^ "> Hello "); + interrupt(); + echo(whoami() ^^ "> Bye "); interrupt(); - echo(whoami () ^^ "> Bye "); if (parent) exit(0) else { - echo(whoami () ^^ "> oops "); var parent = fork(); - (if (parent) su(Root) else exit(1)); - echo(whoami () ^^ "> !! ") + interrupt(); + (if (parent) su(Root) + else { + echo(whoami() ^^ "> oops "); + exit(1) + }); + echo(whoami() ^^ "> !! ") } }) })