[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] Fix setsid(0)
From: |
Thomas Bushnell BSG |
Subject: |
Re: [RFC] Fix setsid(0) |
Date: |
Wed, 18 Jan 2006 19:15:42 -0800 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) |
Samuel Thibault <samuel.thibault@ens-lyon.org> writes:
> Thomas Bushnell BSG, le Tue 17 Jan 2006 13:56:05 -0800, a écrit :
>> The same situation happens with getpgid, and you will see that in the
>> case of getpgid, the C library handles the zero-argument case itself.
>>
>> I believe that the same should be done here, for the sake of
>> consistency.
>>
>> So it seems to me that we should fix this by changing
>> sysdeps/mach/hurd/getsid.c in the C library source instead.
>
> Here it is.
>
> [glibc]/ChangeLog
> 2006-01-18 Samuel Thibault <samuel.thibault@ens-lyon.org>
>
> Fix getsid(0).
>
> * sysdeps/mach/hurd/getsid.c (getsid): When parameter
> `pid' is 0, use _hurd_pid instead.
>
> --- glibc/sysdeps/mach/hurd/getsid.c 2006-01-18 23:43:53.000000000 +0100
> +++ glibc/sysdeps/mach/hurd/getsid.c 2006-01-18 23:19:33.000000000 +0100
> @@ -28,6 +28,9 @@ getsid (pid_t pid)
> error_t err;
> pid_t sid;
>
> + if (pid == 0)
> + pid = _hurd_pid;
> +
> err = __USEPORT (PROC, __proc_getsid (port, pid, &sid));
> if (err)
> return (pid_t) __hurd_fail (err);
That looks good to me; of course it has to be submitted to the C
library maintainer.
Thomas
- Re: [RFC] Fix getsid(0), (continued)
Re: [RFC] Fix setsid(0), Thomas Bushnell BSG, 2006/01/17
Re: [RFC] Fix setsid(0), Samuel Thibault, 2006/01/18
Re: [RFC] Fix setsid(0),
Thomas Bushnell BSG <=