From cd4c2da20a24116117842060798002032c4f5bb0 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 11 Apr 2022 15:45:36 -0500 Subject: [PATCH] Update man page URL in hello/skeleton examples, and fix hello to wait for PID 1. (rdinit=/bin/hello would kernel panic if pid 1 exits, and wait() returns "No child processes" error, so pause() instead.) --- toys/example/hello.c | 4 ++-- toys/example/skeleton.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toys/example/hello.c b/toys/example/hello.c index 3e68f215..101fdd0e 100644 --- a/toys/example/hello.c +++ b/toys/example/hello.c @@ -5,7 +5,7 @@ * See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ * See http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/cmdbehav.html * See https://www.ietf.org/rfc/rfc3.txt - * See http://man7.org/linux/man-pages/dir_section_1.html + * see https://man7.org/linux/man-pages/man1/intro.1.html USE_HELLO(NEWTOY(hello, 0, TOYFLAG_USR|TOYFLAG_BIN)) @@ -33,5 +33,5 @@ void hello_main(void) xprintf("Hello world\n"); // Avoid kernel panic if run as init. - if (getpid() == 1) wait(&TT.unused); + if (getpid() == 1) getchar(); } diff --git a/toys/example/skeleton.c b/toys/example/skeleton.c index d6712b8e..7f60d617 100644 --- a/toys/example/skeleton.c +++ b/toys/example/skeleton.c @@ -6,7 +6,7 @@ * See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ * See http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/cmdbehav.html * See https://www.ietf.org/rfc/rfc3.txt - * See http://man7.org/linux/man-pages/dir_section_1.html + * See https://man7.org/linux/man-pages/man1/intro.1.html // Accept many different kinds of command line argument (see top of lib/args.c) // Demonstrate two commands in the same file (see www/documentation.html) -- 2.39.2