For getsid(), return the sid stored in struct session. This prevents

panic in case where a session has no session leader.

Inspired by:	Solaris 8
This commit is contained in:
Seigo Tanimura 2002-01-19 05:31:51 +00:00
parent 84e76dff37
commit a6fccfb5f2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=89541

View file

@ -1028,7 +1028,7 @@ svr4_sys_pgrpsys(td, uap)
* This has already been initialized to the pid of
* the session leader.
*/
*retval = (register_t) p->p_session->s_leader->p_pid;
*retval = (register_t) p->p_session->s_sid;
PROC_UNLOCK(p);
return 0;