Re: sh and process management

2006-07-16 Thread Otto Moerbeek
On Sun, 16 Jul 2006, Gustavo Rios wrote: > Ok, here you have it: I'm sorry, but I'm not gonna go though this bit flag mess. Until you come up with a simple (let's say less than 10 lines) piece of code to demonstrate the porblem you're seeing, my conclusion is the bug is hiding in your code.

Re: sh and process management

2006-07-16 Thread Philip Guenther
On 7/16/06, Gustavo Rios <[EMAIL PROTECTED]> wrote: ... static int do_sid(const xlong f) { int r; if (r = 0, f & 1) if (f & 2) { if (apx_setsid() == -1) r = -1; } else r = apx_setpgid(0l, apx_getpid()); return r; } Wow, what an annoy

Re: sh and process management

2006-07-16 Thread Gustavo Rios
Ok, here you have it: Code for apx_setuid : #include long apx_setsid(void) { return setsid(); } Code for apx_setpgid : #include int apx_setpgid(const long p, const long g) { return setpgid((pid_t)p, (pid_t)g); } Code for sux (main.c) : (the relevant part is option -s and fun

Re: sh and process management

2006-07-16 Thread Philip Guenther
On 7/15/06, Gustavo Rios <[EMAIL PROTECTED]> wrote: i am trying to set a process as the session leader of its own. I wrote a simple program that handles that. It is working when i call it from my shell command line: ... But when i write a simple shell script like in : The process is not

Re: sh and process management

2006-07-15 Thread Otto Moerbeek
On Sun, 16 Jul 2006, Gustavo Rios wrote: > Hey folks, > > i am trying to set a process as the session leader of its own. I wrote > a simple program that handles that. It is working when i call it from > my shell command line: > > $ sux -s -e -E \ > PATH==/home/grios/.bin:/bin:/sbin:/usr/bin:/usr

sh and process management

2006-07-15 Thread Gustavo Rios
Hey folks, i am trying to set a process as the session leader of its own. I wrote a simple program that handles that. It is working when i call it from my shell command line: $ sux -s -e -E \ PATH==/home/grios/.bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/