aboutsummaryrefslogtreecommitdiff
path: root/boot/userland-boot.c
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2017-02-28 17:57:37 +0100
committerJustus Winter <justus@gnupg.org>2017-02-28 18:02:40 +0100
commit5ac0c5c8e2e13217aabe7dd6e91ff218d0db6346 (patch)
tree7f6da331d141f618c13c6862843d394776dff3cd /boot/userland-boot.c
parent9beba9b6d168f59eeb74859ab5d88d9cabfe6f37 (diff)
downloadhurd-5ac0c5c8e2e13217aabe7dd6e91ff218d0db6346.tar.gz
hurd-5ac0c5c8e2e13217aabe7dd6e91ff218d0db6346.tar.bz2
hurd-5ac0c5c8e2e13217aabe7dd6e91ff218d0db6346.zip
boot: Add a verbose option.
* boot/boot.c (verbose): New variable. (options): New option. (parse_opt): Handle new option. (ds_device_open): Be verbose if so desired. (task_died): Likewise. (S_mach_notify_new_task): Likewise. * boot/userland-boot.c (boot_script_task_create): Likewise. (boot_script_task_resume): Likewise. * boot/private.h: New file.
Diffstat (limited to 'boot/userland-boot.c')
-rw-r--r--boot/userland-boot.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/boot/userland-boot.c b/boot/userland-boot.c
index 583078f1..2f9bd8cd 100644
--- a/boot/userland-boot.c
+++ b/boot/userland-boot.c
@@ -31,6 +31,7 @@
#include <error.h>
#include "boot_script.h"
+#include "private.h"
void *
boot_script_malloc (unsigned int size)
@@ -48,7 +49,12 @@ boot_script_free (void *ptr, unsigned int size)
int
boot_script_task_create (struct cmd *cmd)
{
- error_t err = task_create (mach_task_self (), 0, &cmd->task);
+ error_t err;
+
+ if (verbose)
+ fprintf (stderr, "Creating task '%s'.\r\n", cmd->path);
+
+ err = task_create (mach_task_self (), 0, &cmd->task);
if (err)
{
error (0, err, "%s: task_create", cmd->path);
@@ -66,7 +72,12 @@ boot_script_task_create (struct cmd *cmd)
int
boot_script_task_resume (struct cmd *cmd)
{
- error_t err = task_resume (cmd->task);
+ error_t err;
+
+ if (verbose)
+ fprintf (stderr, "Resuming task '%s'.\r\n", cmd->path);
+
+ err = task_resume (cmd->task);
if (err)
{
error (0, err, "%s: task_resume", cmd->path);