lkml.org 
[lkml]   [2006]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] dup fd error
From
Date

set errorp in dup_fd, it will be used in sys_unshare also.

Signed-off-by: Prasanna Meda

--- a/kernel/fork.c 2006-04-17 22:38:09.000000000 +0530
+++ b/kernel/fork.c 2006-04-18 00:38:37.000000000 +0530
@@ -629,6 +629,7 @@ out:
/*
* Allocate a new files structure and copy contents from the
* passed in files structure.
+ * errorp will be valid only when the returned files_struct is NULL.
*/
static struct files_struct *dup_fd(struct files_struct *oldf, int *errorp)
{
@@ -637,6 +638,7 @@ static struct files_struct *dup_fd(struc
int open_files, size, i, expand;
struct fdtable *old_fdt, *new_fdt;

+ *errorp = -ENOMEM;
newf = alloc_files();
if (!newf)
goto out;
@@ -750,7 +752,6 @@ static int copy_files(unsigned long clon
* break this.
*/
tsk->files = NULL;
- error = -ENOMEM;
newf = dup_fd(oldf, &error);
if (!newf)
goto out;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-04-17 21:26    [W:0.022 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site