diff options
| author | Michael Bergknoff <Michael.Bergknoff@Sun.COM> | 2009-02-12 07:18:45 -0800 |
|---|---|---|
| committer | Michael Bergknoff <Michael.Bergknoff@Sun.COM> | 2009-02-12 07:18:45 -0800 |
| commit | d5da6539351bab864692146ea0d7c5044d1333c6 (patch) | |
| tree | b55a09f0b582d26e942ffbf8e241e09278efda4c /usr/src/cmd/picl | |
| parent | fd8a887ec6f9bad936b45b2d9f492a97db9df47d (diff) | |
| download | illumos-joyent-d5da6539351bab864692146ea0d7c5044d1333c6.tar.gz | |
6737402 picld is leaking threads after 6547926 putback
6718653 picld should close all its inherited file descriptors when becoming a daemon.
Diffstat (limited to 'usr/src/cmd/picl')
| -rw-r--r-- | usr/src/cmd/picl/picld/picld.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/usr/src/cmd/picl/picld/picld.c b/usr/src/cmd/picl/picld/picld.c index 70ba0a6065..ae67fd7581 100644 --- a/usr/src/cmd/picl/picld/picld.c +++ b/usr/src/cmd/picl/picld/picld.c @@ -20,12 +20,10 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * PICL daemon */ @@ -993,6 +991,16 @@ picld_server_create_fn(door_info_t *dip) { pthread_attr_t attr; + /* + * For the non-private pool do nothing. It's used for events which are + * single threaded anyway. The single thread servicing that pool is + * created when the event plugin creates its door. Note that the event + * plugin runs before setup_door instantiates picld_server_create_fn as + * the new create_proc so the door library default create_proc is used. + */ + if (dip == NULL) + return; + (void) pthread_mutex_lock(&pool_mutex); if (pool_count < MAX_POOL_SIZE) { (void) pthread_attr_init(&attr); @@ -1156,9 +1164,7 @@ main(int argc, char **argv) } (void) setsid(); - (void) close(STDIN_FILENO); - (void) close(STDOUT_FILENO); - (void) close(STDERR_FILENO); + closefrom(0); (void) open("/dev/null", O_RDWR, 0); (void) dup2(STDIN_FILENO, STDOUT_FILENO); (void) dup2(STDIN_FILENO, STDERR_FILENO); |
