From: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
To: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
Cc: Containers
<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org
Subject: [PATCH 1/2] Fix app_checkpoint() return code
Date: Tue, 30 Mar 2010 23:54:43 -0700 [thread overview]
Message-ID: <20100331065443.GA21065@us.ibm.com> (raw)
From: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Date: Tue, 30 Mar 2010 18:59:10 -0700
Subject: [PATCH 1/2] Fix app_checkpoint() return code
Have app_checkpoint() return the return value from the system call
so callers find some useful information. Have main() can convert the
return value into a suitable exit status.
Signed-off-by: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
---
checkpoint-main.c | 4 +++-
checkpoint.c | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/checkpoint-main.c b/checkpoint-main.c
index f6faa32..bac65cc 100644
--- a/checkpoint-main.c
+++ b/checkpoint-main.c
@@ -145,6 +145,7 @@ static void parse_args(struct app_checkpoint_args *args, int argc, char *argv[])
int main(int argc, char *argv[])
{
+ int ret;
struct app_checkpoint_args args;
unsigned long flags = 0;
pid_t pid;
@@ -167,5 +168,6 @@ int main(int argc, char *argv[])
if (!args.container)
flags |= CHECKPOINT_SUBTREE;
- return app_checkpoint(pid, flags, &args);
+ ret = app_checkpoint(pid, flags, &args);
+ return (ret > 0) ? 0 : 1;
}
diff --git a/checkpoint.c b/checkpoint.c
index e3a1ce8..e0290c9 100644
--- a/checkpoint.c
+++ b/checkpoint.c
@@ -55,5 +55,5 @@ int app_checkpoint(int pid, unsigned long flags,
ckpt_err("checkpoint id %d\n", ret);
}
- return (ret > 0 ? 0 : 1);
+ return ret;
}
--
1.6.6.1
next reply other threads:[~2010-03-31 6:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-31 6:54 Sukadev Bhattiprolu [this message]
[not found] ` <20100331065443.GA21065-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-31 6:56 ` [PATCH 2/2] Add keep_frozen field to struct app_restart_args Sukadev Bhattiprolu
2010-04-01 4:59 ` [PATCH 1/2] Fix app_checkpoint() return code Oren Laadan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100331065443.GA21065@us.ibm.com \
--to=sukadev-23vcf4htsmix0ybbhkvfkdbpr1lh4cv8@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox