new helper: daemonize_descriptors()
descriptor-related parts of daemonize, done right. As the result we simplify the locking rules for ->files - we hold task_lock in *all* cases when we modify ->files. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
2be7fd55d4
commit
864bdb3b6c
3 changed files with 8 additions and 3 deletions
|
@ -457,9 +457,7 @@ void daemonize(const char *name, ...)
|
|||
/* Become as one with the init task */
|
||||
|
||||
daemonize_fs_struct();
|
||||
exit_files(current);
|
||||
current->files = init_task.files;
|
||||
atomic_inc(¤t->files->count);
|
||||
daemonize_descriptors();
|
||||
|
||||
reparent_to_kthreadd();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue