Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44011
b: refs/heads/master
c: f3d19c9
h: refs/heads/master
i:
  44009: 9daa69a
  44007: 54aa199
v: v3
  • Loading branch information
Vadim Lobanov authored and Linus Torvalds committed Dec 10, 2006
1 parent 5a56c0d commit 91d8572
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 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: 5eb6c7a2ab413dea1ee6c08dd58263a1c2c2efa3
refs/heads/master: f3d19c90fb117a5f080310a4592929aa8e1ad8e9
11 changes: 5 additions & 6 deletions trunk/kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,10 @@ static struct files_struct *dup_fd(struct files_struct *oldf, int *errorp)
old_fds = old_fdt->fd;
new_fds = new_fdt->fd;

memcpy(new_fdt->open_fds->fds_bits, old_fdt->open_fds->fds_bits, open_files/8);
memcpy(new_fdt->close_on_exec->fds_bits, old_fdt->close_on_exec->fds_bits, open_files/8);
memcpy(new_fdt->open_fds->fds_bits,
old_fdt->open_fds->fds_bits, open_files/8);
memcpy(new_fdt->close_on_exec->fds_bits,
old_fdt->close_on_exec->fds_bits, open_files/8);

for (i = open_files; i != 0; i--) {
struct file *f = *old_fds++;
Expand Down Expand Up @@ -745,14 +747,11 @@ static struct files_struct *dup_fd(struct files_struct *oldf, int *errorp)
memset(&new_fdt->close_on_exec->fds_bits[start], 0, left);
}

out:
return newf;

out_release:
free_fdset (new_fdt->close_on_exec, new_fdt->max_fdset);
free_fdset (new_fdt->open_fds, new_fdt->max_fdset);
free_fd_array(new_fdt->fd, new_fdt->max_fds);
kmem_cache_free(files_cachep, newf);
out:
return NULL;
}

Expand Down

0 comments on commit 91d8572

Please sign in to comment.