[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v7 2/8] cxenstored: add support for systemd active sockets



On Mon, Jul 28, 2014 at 10:48:12AM +0100, Ian Campbell wrote:
> On Sat, 2014-07-26 at 00:45 +0200, Luis R. Rodriguez wrote:
> > > > +       n = sd_listen_fds(0);
> > > > +       if (n <= 0) {
> > > > +               sd_notifyf(0, "STATUS=Failed to get any active sockets: 
> > > > %s\n"
> > > > +                          "ERRNO=%i",
> > > > +                          strerror(errno),
> > > > +                          errno);
> > > > +               barf_perror("sd_listen_fds() failed\n");
> > > > +       } else if (n > 2) {
> > > > +               fprintf(stderr, SD_ERR "Expected 2 fds but given %d\n", 
> > > > n);
> > > > +               sd_notifyf(0, "STATUS=Mismatch on number (2): %s\n"
> > > > +                          "ERRNO=%d",
> > > 
> > > You've used %u everywhere else...
> > 
> > Sorry this was not clear, I don't see usage of %u in my patches.
> 
> Sorry, looks like I meant %i not %u. %i and %d are equivalent, so I
> suppose it's just a code consistency nit.

OK.

> > > Perhaps you wanted to send n in the STATUS?
> > 
> > There's an fprintf(stderr) right above above that provides the n variables,
> > when you use fprintf(stderr) that goes the systemd journal as well.
> 
> Hrm, so either the sd_notify or the fprintf is a bit redundant then?

fprintf() is just easier for separate calls you can call one sd_notify() with
the status though so I printed earlier segments with fpritnf().

  Luis

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.