[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] Fix setsid(0)
From: |
Samuel Thibault |
Subject: |
Re: [RFC] Fix setsid(0) |
Date: |
Thu, 19 Jan 2006 00:29:49 +0100 |
User-agent: |
Mutt/1.5.9i-nntp |
Hi,
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);
- Re: [RFC] Fix setsid(0), (continued)
Re: [RFC] Fix setsid(0), Thomas Bushnell BSG, 2006/01/17
Re: [RFC] Fix setsid(0),
Samuel Thibault <=
Re: [RFC] Fix setsid(0), Thomas Bushnell BSG, 2006/01/18