Re: [patch] khttpd doesn't detach from the files of its parent

2000-10-18 Thread Alexander Viro
On Wed, 18 Oct 2000, Alessandro Rubini wrote: > > > put_files_struct() is a destructor, so it won't help here. The following > > patch may be of use [...] It's "create an empty > > files_struct and replace the task->files with it" - thing we can't do via > > clone() and may want to (khttpd doe

Re: [patch] khttpd doesn't detach from the files of its parent

2000-10-18 Thread Alessandro Rubini
> put_files_struct() is a destructor, so it won't help here. The following > patch may be of use [...] It's "create an empty > files_struct and replace the task->files with it" - thing we can't do via > clone() and may want to (khttpd does). Sorry, what's wrong with just closing the files? It's

Re: [patch] khttpd doesn't detach from the files of its parent

2000-10-18 Thread Alexander Viro
On Wed, 18 Oct 2000, Jeff Garzik wrote: > Alexander Viro wrote: > > On Wed, 18 Oct 2000, Alessandro Rubini wrote: > > > > shouldn't this be exit_files() ? > > > > Yes, definitely. > > > Arjan already replied (privately) to say the same. > > > It should, unless you want to open any files in th

Re: [patch] khttpd doesn't detach from the files of its parent

2000-10-18 Thread Alexander Viro
On Wed, 18 Oct 2000, Arjan van de Ven wrote: > In article <[EMAIL PROTECTED]> you wrote: > > > It should, unless you want to open any files in the thread itself. > > Oh damn. kHTTPd does need to open files later on.. > > Reading the code to exit_files() suggests I actually need put_file

Re: [patch] khttpd doesn't detach from the files of its parent

2000-10-18 Thread Alessandro Rubini
>> Yes, definitely. > > It should, unless you want to open any files in the thread itself. Yes. I realized that just before getting your message (after looking at kernel/exit.c). I should never say "definitely" :) /alessandro - To unsubscribe from this list: send the line "unsubscribe linux-ker

Re: [patch] khttpd doesn't detach from the files of its parent

2000-10-18 Thread Jeff Garzik
Alexander Viro wrote: > On Wed, 18 Oct 2000, Alessandro Rubini wrote: > > > shouldn't this be exit_files() ? > > Yes, definitely. > > Arjan already replied (privately) to say the same. > It should, unless you want to open any files in the thread itself. If you start a kernel thread which opens

Re: [patch] khttpd doesn't detach from the files of its parent

2000-10-18 Thread Alexander Viro
On Wed, 18 Oct 2000, Alessandro Rubini wrote: > > > shouldn't this be exit_files() ? > > Yes, definitely. > Arjan already replied (privately) to say the same. It should, unless you want to open any files in the thread itself. - To unsubscribe from this list: send the line "unsubscribe linux

Re: [patch] khttpd doesn't detach from the files of its parent

2000-10-18 Thread Alessandro Rubini
> shouldn't this be exit_files() ? Yes, definitely. Arjan already replied (privately) to say the same. Thanks /alessandro - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/

Re: [patch] khttpd doesn't detach from the files of its parent

2000-10-18 Thread John Levon
On Wed, 18 Oct 2000, Alessandro Rubini wrote: > + /* init_module has stdin/stdout/stderr open: close them (ARub) */ > + for (i=255; i>=0; i--) > + if (current->files->fd[i]) > + close(i); > shouldn't this be exit_files() ? see md.c for an example usage

[patch] khttpd doesn't detach from the files of its parent

2000-10-18 Thread Alessandro Rubini
Hi all. While looking at kHTTPd (linux-2.4.0-test9) I found what looks like a bug to me. The daemon doesn't detach itself from the files structure of the parent process. Therefore, when it is run as a module, the files opened by "insmod" (or whatever loads it) remain open. Besides "aesthetica