From: Oren Laadan <orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
To: Matt Helsley <matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: [PATCH] user-cr: add --output-fd to write output to a specific fd
Date: Mon, 26 Oct 2009 15:39:19 -0400 [thread overview]
Message-ID: <4AE5FAE7.5090003@librato.com> (raw)
In-Reply-To: <20091026174305.GI31446-52DBMbEzqgQ/wnmkkaCWp/UQ3DHhIser@public.gmane.org>
yeah .. I was lazy .. will add another patch.
Oren.
Matt Helsley wrote:
> On Sun, Oct 25, 2009 at 06:13:21PM -0400, Oren Laadan wrote:
>> This is useful if the user would like redirect the output to
>> e.g, a socket or any other already open file descriptor when
>> invoking 'checkpoint'.
>>
>> Also useful if the user would like to append an existing file.
>>
>> Signed-off-by: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
>> ---
>> checkpoint.c | 47 +++++++++++++++++++++++++++++++++++++++++------
>> 1 files changed, 41 insertions(+), 6 deletions(-)
>>
>> diff --git a/checkpoint.c b/checkpoint.c
>> index c116daf..aef954b 100644
>> --- a/checkpoint.c
>> +++ b/checkpoint.c
>> @@ -32,12 +32,14 @@ static char usage_str[] =
>> "\tOptions:\n"
>> " -h,--help print this help message\n"
>> " -o,--output=FILE write data to FILE instead of standard output\n"
>> +" --output-fd=FD write data to file descriptor FD instead of stdout\n"
>> " -c,--container require the PID is a container-init\n"
>> " -v,--verbose verbose output\n"
>> "";
>>
>> struct args {
>> char *output;
>> + int outputfd;
>> int container;
>> int verbose;
>> };
>> @@ -53,17 +55,33 @@ static void usage(char *str)
>> exit(1);
>> }
>>
>> +/* negative retval means error */
>> +static int str2num(char *str)
>> +{
>> + char *nptr;
>> + int num;
>> +
>> + num = strtol(str, &nptr, 10);
>> + if (nptr - str != strlen(str))
>> + num = -1;
>> + return num;
>> +}
>
> It'd be nice to see common functions in a shared .o between
> checkpoint and restart.
>
> Cheers,
> -Matt Helsley
>
prev parent reply other threads:[~2009-10-26 19:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-25 22:13 [PATCH] user-cr: add --output-fd to write output to a specific fd Oren Laadan
[not found] ` <1256508801-2426-1-git-send-email-orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
2009-10-26 16:50 ` Serge E. Hallyn
2009-10-26 17:43 ` Matt Helsley
[not found] ` <20091026174305.GI31446-52DBMbEzqgQ/wnmkkaCWp/UQ3DHhIser@public.gmane.org>
2009-10-26 19:39 ` Oren Laadan [this message]
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=4AE5FAE7.5090003@librato.com \
--to=orenl-rdfvbdnroixbdgjk7y7tuq@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=matthltc-r/Jw6+rmf7HQT0dZR+AlfA@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.