Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328983
b: refs/heads/master
c: 864bdb3
h: refs/heads/master
i:
  328981: 70983a5
  328979: 349d9fd
  328975: 9f77a8d
v: v3
  • Loading branch information
Al Viro committed Sep 27, 2012
1 parent 3e7d615 commit 0051698
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2be7fd55d44882c9818ed2d1dabc0f0abab5eeed
refs/heads/master: 864bdb3b6cbd9911222543fef1cfe36f88183f44
6 changes: 6 additions & 0 deletions trunk/fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,12 @@ struct files_struct init_files = {
.file_lock = __SPIN_LOCK_UNLOCKED(init_task.file_lock),
};

void daemonize_descriptors(void)
{
atomic_inc(&init_files.count);
reset_files_struct(&init_files);
}

/*
* allocate a file descriptor, mark it busy.
*/
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/fdtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ struct task_struct;
struct files_struct *get_files_struct(struct task_struct *);
void put_files_struct(struct files_struct *fs);
void reset_files_struct(struct files_struct *);
void daemonize_descriptors(void);
int unshare_files(struct files_struct **);
struct files_struct *dup_fd(struct files_struct *, int *);
void do_close_on_exec(struct files_struct *);
Expand Down
4 changes: 1 addition & 3 deletions trunk/kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(&current->files->count);
daemonize_descriptors();

reparent_to_kthreadd();
}
Expand Down

0 comments on commit 0051698

Please sign in to comment.