From 1c69c16ed2f970b147626ba1155a06d2ec81a0b6 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 22 Sep 2004 00:29:01 +0000 Subject: [PATCH] Make more useful. --- src/tests/userprog/recursor.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/tests/userprog/recursor.c b/src/tests/userprog/recursor.c index b7422f1..f787a90 100644 --- a/src/tests/userprog/recursor.c +++ b/src/tests/userprog/recursor.c @@ -19,13 +19,16 @@ main (int argc, char *argv[]) printf ("%s %s %s %s\n", argv[0], argv[1], argv[2], argv[3]); /* Execute child and wait for it to finish if requested. */ - snprintf (buffer, sizeof buffer, - "recursor fork %d %s", atoi (argv[2]) + 1, argv[3]); - pid = exec (buffer); - if (atoi (argv[3])) - retval = join (pid); - + if (atoi (argv[2]) != 0) + { + snprintf (buffer, sizeof buffer, + "recursor %s %d %s", argv[1], atoi (argv[2]) - 1, argv[3]); + pid = exec (buffer); + if (atoi (argv[3])) + retval = join (pid); + } + /* Done. */ - printf ("%s: dying, retval=%d\n", argv[1], retval); + printf ("%s %s: dying, retval=%d\n", argv[1], argv[2], retval); exit (retval); } -- 2.30.2