[lxc-devel] [PATCH 2/2] Use SYSERROR instead of perror

St├ęphane Graber stgraber at ubuntu.com
Mon Apr 6 16:07:54 UTC 2015


On Sat, Apr 04, 2015 at 01:54:10AM +0000, Serge Hallyn wrote:
> Quoting Tycho Andersen (tycho.andersen at canonical.com):
> > It is impolite to print stuff to stderror owned by other people, and they might
> > miss it anyway since it's not in the normal log location.
> > 
> > Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
> 
> Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

This patch won't apply to git master, can you send a rebased version?

> 
> > ---
> >  src/lxc/lxccontainer.c | 10 ++++------
> >  1 file changed, 4 insertions(+), 6 deletions(-)
> > 
> > diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
> > index 88cdf55..528101b 100644
> > --- a/src/lxc/lxccontainer.c
> > +++ b/src/lxc/lxccontainer.c
> > @@ -3880,7 +3880,7 @@ static bool lxcapi_checkpoint(struct lxc_container *c, char *directory, bool sto
> >  	} else {
> >  		pid_t w = waitpid(pid, &status, 0);
> >  		if (w == -1) {
> > -			perror("waitpid");
> > +			SYSERROR("waitpid");
> >  			return false;
> >  		}
> >  
> > @@ -4003,7 +4003,7 @@ static void do_restore(struct lxc_container *c, int pipe, char *directory, bool
> >  
> >  		pid_t w = waitpid(pid, &status, 0);
> >  		if (w == -1) {
> > -			perror("waitpid");
> > +			SYSERROR("waitpid");
> >  			goto out_fini_handler;
> >  		}
> >  
> > @@ -4012,8 +4012,7 @@ static void do_restore(struct lxc_container *c, int pipe, char *directory, bool
> >  		pipe = -1;
> >  
> >  		if (sizeof(status) != ret) {
> > -			perror("write");
> > -			ERROR("failed to write all of status");
> > +			SYSERROR("failed to write all of status");
> >  			goto out_fini_handler;
> >  		}
> >  
> > @@ -4024,8 +4023,7 @@ static void do_restore(struct lxc_container *c, int pipe, char *directory, bool
> >  				int ret;
> >  				FILE *f = fopen(pidfile, "r");
> >  				if (!f) {
> > -					perror("reading pidfile");
> > -					ERROR("couldn't read restore's init pidfile %s\n", pidfile);
> > +					SYSERROR("couldn't read restore's init pidfile %s\n", pidfile);
> >  					goto out_fini_handler;
> >  				}
> >  
> > -- 
> > 2.1.4
> > 
> > _______________________________________________
> > lxc-devel mailing list
> > lxc-devel at lists.linuxcontainers.org
> > http://lists.linuxcontainers.org/listinfo/lxc-devel
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
St├ęphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20150406/b9e50684/attachment.sig>


More information about the lxc-devel mailing list