On Sat, May 10, 2014 at 10:17:13AM +0800, Zhenhua Luo wrote:
> when setsid failed, the pid and sid doesn't equal, so remove following
> condition statement.
>     if (getsid(0) != pid)
> 
<snip>
> 
> Fix following runtime issue of getty:
> root@p1025:~# getty 115200 /dev/ttyQE1
> getty: setsid: Operation not permitted
> 
> Signed-off-by: Zhenhua Luo <[email protected]>
> ---
>  loginutils/getty.c | 9 ---------
>  1 file changed, 9 deletions(-)
> 
> diff --git a/loginutils/getty.c b/loginutils/getty.c
> index 0f060ae..6bfdf43 100644
> --- a/loginutils/getty.c
> +++ b/loginutils/getty.c
> @@ -548,15 +548,6 @@ int getty_main(int argc UNUSED_PARAM, char **argv)
>                * a session leader - which is quite possible for getty!
>                */
>               pid = getpid();
> -             if (getsid(0) != pid) {
> -                     //for debugging:
> -                     //bb_perror_msg_and_die("setsid failed:"
> -                     //      " pid %d ppid %d"
> -                     //      " sid %d pgid %d",
> -                     //      pid, getppid(),
> -                     //      getsid(0), getpgid(0));
> -                     bb_perror_msg_and_die("setsid");
> -             }
>               /* Looks like we are already a session leader.
>                * In this case (setsid failed) we may still have ctty,
>                * and it may be different from tty we need to control!
> -- 
> 1.9.1

You might want to read the comments surrounding this.
If I understand correctly, the behavior you're "fixing" is the intended
behavior.
And even if it weren't correct, the comments would need to be updated.

Thanks,
Isaac Dunham
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to