[Nut-upsdev] MSG_NOSIGNAL does not exist in OS X

Arnaud Quette aquette.dev at gmail.com
Mon Feb 11 08:44:32 UTC 2008

2008/2/11, Charles Lepple <clepple at gmail.com>:
> On Feb 10, 2008 3:06 PM, Arjen de Korte <nut+devel at de-korte.org> wrote:
> > > I'm seeing an error with the XML/HTTP driver in NUT:
> >
> > [...]
> >
> > > What is the side effect of not using MSG_NOSIGNAL? I could just
> > > #define it to 0, but I don't know if this would cause any problems.
> >
> > The MSG_NOSIGNAL prevents send() from sending the SIGPIPE signal in case
> > the connection is broken and instead it will only return errno EPIPE. In
> > NUT drivers, there is no difference, since we ignore this signal (through
> > setup_signals() in 'main.c') anyway.
> Heh, I was hoping Arnaud could tell us something more than what the
> man page says :-)
> I guess I was thinking that it was probably added for a reason, and I
> was really trying to find out if that reason was something more than
> "because it was in some older code".

Arjen is right: this is not needed in NUT.
No reason other than the need in my test code...

> > Since MSG_NOSIGNAL is not POSIX compliant, it should not be used. I've
> > volunteered to work on this, so this will be fixed when the 'libtcp' (I'm
> > open to suggestions for better names) I'm working on is ready. It will
> > have a similar interface as the ser_* functions we already have in
> > 'serial.c' (now you also know where my recent changes originate from).
> Well, as a short-term fix, I think we can test for it and #define it
> to 0. I don't know the timeline for libtcp, but if Arnaud wants to
> push the XML/HTTP driver into Testing soon, then the #define would be
> a good short-term fix (assuming that it really wouldn't be needed on
> OS X).

removing it from the send is fine.

Linux / Unix Expert R&D - MGE Office Protection Systems - http://www.mgeops.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://people.debian.org/~aquette/
Free Software Developer - http://arnaud.quette.free.fr/

More information about the Nut-upsdev mailing list