Skip to contentSkip to conversation

checkpoint: define pid==0 as self-checkpoint

PATCH In review Serge E. Hallyn 2 participants 2 messages Mar 5, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpoint: define pid==0 as self-checkpoint

[ this is on top of Dave's version of Oren's patchset, i.e.
http://git.kernel.org/gitweb.cgi?p=linux/kernel/git/daveh/linux-2.6-cr.git;a=shortlog;h=dave-v13.4 ]

Define pid=0 when calling sys_checkpoint as asking for a self-checkpoint.

---
 checkpoint/sys.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
checkpoint/sys.c +2 -0
index 4a51ed3..acc5121 100644
@@ -224,6 +224,8 @@ asmlinkage long sys_checkpoint(pid_t pid, int fd, unsigned long flags)
 	if (flags)
 		return -EINVAL;
 
+	if (pid == 0)
+		pid = current->pid;
 	ctx = cr_ctx_alloc(fd, flags | CR_CTX_CKPT);
 	if (IS_ERR(ctx))
 		return PTR_ERR(ctx);
Signature · 1 line
1.5.4.3
#1 lore raw

SH> Define pid=0 when calling sys_checkpoint as asking for a SH> self-checkpoint.

Works for me (of course).

Signature · 3 lines
Dan Smith
IBM Linux Technology Center
email: [email protected]