linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dup fd error
@ 2006-04-17 19:23 Prasanna Meda
  0 siblings, 0 replies; only message in thread
From: Prasanna Meda @ 2006-04-17 19:23 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, linux-mm

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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-17 19:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-17 19:23 [PATCH] dup fd error Prasanna Meda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox