diff options
author | kib <kib@FreeBSD.org> | 2016-04-04 06:49:20 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2016-04-04 06:49:20 +0000 |
commit | dd5102e0a5e3fb1d7f10b3562fc2d63cdc235e2b (patch) | |
tree | fc099df3169de8b23381240be395de049121b8d7 /lib/libthr/thread/thr_init.c | |
parent | 9e293a9e32a57c9a05734c0213a3c609ca4dec68 (diff) | |
download | FreeBSD-src-dd5102e0a5e3fb1d7f10b3562fc2d63cdc235e2b.zip FreeBSD-src-dd5102e0a5e3fb1d7f10b3562fc2d63cdc235e2b.tar.gz |
MFC r297139:
From libthr, remove special and strange code to set up session and
control terminal, activated when running with pid 1.
Diffstat (limited to 'lib/libthr/thread/thr_init.c')
-rw-r--r-- | lib/libthr/thread/thr_init.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index 9a1a67a..14114b3 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -303,7 +303,7 @@ _thread_init_hack(void) void _libpthread_init(struct pthread *curthread) { - int fd, first, dlopened; + int first, dlopened; /* Check if this function has already been called: */ if ((_thr_initial != NULL) && (curthread == NULL)) @@ -319,27 +319,6 @@ _libpthread_init(struct pthread *curthread) memcpy(__thr_jtable, jmp_table, sizeof(jmp_table)); __thr_interpose_libc(); - /* - * Check for the special case of this process running as - * or in place of init as pid = 1: - */ - if ((_thr_pid = getpid()) == 1) { - /* - * Setup a new session for this process which is - * assumed to be running as root. - */ - if (setsid() == -1) - PANIC("Can't set session ID"); - if (revoke(_PATH_CONSOLE) != 0) - PANIC("Can't revoke console"); - if ((fd = __sys_open(_PATH_CONSOLE, O_RDWR)) < 0) - PANIC("Can't open console"); - if (setlogin("root") == -1) - PANIC("Can't set login to root"); - if (_ioctl(fd, TIOCSCTTY, (char *) NULL) == -1) - PANIC("Can't set controlling terminal"); - } - /* Initialize pthread private data. */ init_private(); |