From 151046c5165860ddea6e84498cc0a0e191de1c40 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 11 Sep 2008 22:48:12 +0200 Subject: Add extra debug for the forked init and setup functions --- src/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 576c983a..cba908f7 100644 --- a/src/main.c +++ b/src/main.c @@ -334,6 +334,7 @@ static void configure_device(int dev_id) { struct hci_dev_req dr; struct hci_dev_info di; + pid_t pid; int dd; if (hci_devinfo(dev_id, &di) < 0) @@ -343,7 +344,8 @@ static void configure_device(int dev_id) return; /* Do configuration in the separate process */ - switch (fork()) { + pid = fork(); + switch (pid) { case 0: atexit(at_child_exit); break; @@ -351,6 +353,7 @@ static void configure_device(int dev_id) error("Fork failed. Can't init device hci%d: %s (%d)", dev_id, strerror(errno), errno); default: + debug("configuration child %d forked", pid); return; } @@ -430,10 +433,12 @@ static void configure_device(int dev_id) static void init_device(int dev_id) { struct hci_dev_info di; + pid_t pid; int dd; /* Do initialization in the separate process */ - switch (fork()) { + pid = fork(); + switch (pid) { case 0: atexit(at_child_exit); break; @@ -441,6 +446,7 @@ static void init_device(int dev_id) error("Fork failed. Can't init device hci%d: %s (%d)", dev_id, strerror(errno), errno); default: + debug("initialization child %d forked", pid); return; } -- cgit