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

Re: Trying to run a Mumble Server



On Thu, 2013-09-19 at 05:38 +0200, Svante Signell wrote:

 
> > > I was wondering why the Qt code is using (fd != -1 || errno != EINVAL) to determine success?
> > 
> > Because Linux probably returns EINVAL instead of EPROTOTYPE in such an
> > error case.
> 
> You can solve this problem with a code construct like (from a pending
> upstream glib2.0 patch. Recent dbus upstream patches use the same
> technique):

In the Qt case you can make it a one-liner:
Change
    if (fd != -1 || errno != EINVAL)
to
    if (fd != -1 || !(errno == ENOSYS || errno == EINVAL))
as already used for accept4 on line 122


Reply to: