diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/include/debug.h | 3 | ||||
-rw-r--r-- | source4/lib/debug.c | 8 | ||||
-rw-r--r-- | source4/lib/events.c | 8 |
3 files changed, 18 insertions, 1 deletions
diff --git a/source4/include/debug.h b/source4/include/debug.h index 814a79a44b..8c82c73557 100644 --- a/source4/include/debug.h +++ b/source4/include/debug.h @@ -30,6 +30,9 @@ struct debug_ops { /* function to return process/thread id */ uint32 (*get_task_id)(void); + + /* function to log process/thread id */ + void (*log_task_id)(int fd); }; void do_debug(const char *, ...) PRINTF_ATTRIBUTE(1,2); diff --git a/source4/lib/debug.c b/source4/lib/debug.c index 792cf14c5a..dbd3946c81 100644 --- a/source4/lib/debug.c +++ b/source4/lib/debug.c @@ -57,6 +57,8 @@ void do_debug(const char *format, ...) vasprintf(&s, format, ap); va_end(ap); + log_task_id(); + write(state.fd, s, strlen(s)); free(s); } @@ -147,6 +149,12 @@ uint32 get_task_id(void) return getpid(); } +void log_task_id(void) +{ + if (debug_handlers.ops.log_task_id) { + debug_handlers.ops.log_task_id(state.fd); + } +} /* register a set of debug handlers. */ diff --git a/source4/lib/events.c b/source4/lib/events.c index f95028b731..00d32043f7 100644 --- a/source4/lib/events.c +++ b/source4/lib/events.c @@ -317,7 +317,13 @@ int event_loop_wait(struct event_context *ev) } - selrtn = sys_select(ev->maxfd+1, &r_fds, &w_fds, NULL, &tval); + /* TODO: + + we don't use sys_select() as it isn't thread + safe. We need to replace the magic pipe handling in + sys_select() with something in the events + structure - for now just use select() */ + selrtn = select(ev->maxfd+1, &r_fds, &w_fds, NULL, &tval); t = time(NULL); |