[PATCH] compat.h: only include compat_netdb.h if needed

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] compat.h: only include compat_netdb.h if needed

Arnout Vandecappelle (Essensium/Mind)
compat_netdb.h is added for only one reason: to provide the definitions
for getaddrinfo, in case it is not provided by the system.
compat_netdb.h is just a copy from an old glibc version, but that makes
it incompatible with other standard C libraries. For example, uClibc
without RPC support doesn't have the rpc/netdb.h header. This leads to
build errors.

To work around this, only include compat_netdb.h when needed, i.e.
when getaddrinfo isn't provided natively.

Note that this getaddrinfo compat was introduced in commit bc54c431 to
support Solaris 7. Starting from Solaris 8, however, getaddrinfo is
available natively, and it's available on MacOS, Windows and any other
POSIX-2001 compliant system as well. So it may be worhtwhile to remove
it altogether.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[hidden email]>
---
 module/owlib/src/include/compat.h   | 2 ++
 module/ownet/c/src/include/compat.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/module/owlib/src/include/compat.h b/module/owlib/src/include/compat.h
index c55bc96..e95e16f 100644
--- a/module/owlib/src/include/compat.h
+++ b/module/owlib/src/include/compat.h
@@ -57,7 +57,9 @@
 #include <features.h>
 #endif
 
+#ifndef HAVE_GETADDRINFO
 #include "compat_netdb.h"
+#endif
 #include "compat_getopt.h"
 
 #ifndef HAVE_STRSEP
diff --git a/module/ownet/c/src/include/compat.h b/module/ownet/c/src/include/compat.h
index c45d852..f8ae759 100644
--- a/module/ownet/c/src/include/compat.h
+++ b/module/ownet/c/src/include/compat.h
@@ -58,7 +58,9 @@ $Id$
 #include <features.h>
 #endif
 
+#ifndef HAVE_GETADDRINFO
 #include "compat_netdb.h"
+#endif
 #include "compat_getopt.h"
 
 #ifndef HAVE_STRSEP
--
2.7.0


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] compat.h: only include compat_netdb.h if needed

Jan Kandziora
Am 09.03.2016 um 23:39 schrieb Arnout Vandecappelle (Essensium/Mind):
> compat_netdb.h is added for only one reason: to provide the definitions
> for getaddrinfo, in case it is not provided by the system.
> compat_netdb.h is just a copy from an old glibc version, but that makes
> it incompatible with other standard C libraries. For example, uClibc
> without RPC support doesn't have the rpc/netdb.h header. This leads to
> build errors.
>
Ah, I wasn't sure what this was all about. Made me a headache with the
Cygwin build.


> To work around this, only include compat_netdb.h when needed, i.e.
> when getaddrinfo isn't provided natively.
>
So, your are sure this is only about getaddrinfo()? We can't ask
Christian Magnusson, I think.

Thanks.

        Jan


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] compat.h: only include compat_netdb.h if needed

Arnout Vandecappelle (Essensium/Mind)
On 03/10/16 02:29, Jan Kandziora wrote:

> Am 09.03.2016 um 23:39 schrieb Arnout Vandecappelle (Essensium/Mind):
>> compat_netdb.h is added for only one reason: to provide the definitions
>> for getaddrinfo, in case it is not provided by the system.
>> compat_netdb.h is just a copy from an old glibc version, but that makes
>> it incompatible with other standard C libraries. For example, uClibc
>> without RPC support doesn't have the rpc/netdb.h header. This leads to
>> build errors.
>>
> Ah, I wasn't sure what this was all about. Made me a headache with the
> Cygwin build.
>
>
>> To work around this, only include compat_netdb.h when needed, i.e.
>> when getaddrinfo isn't provided natively.
>>
> So, your are sure this is only about getaddrinfo()? We can't ask
> Christian Magnusson, I think.

  The header declares getaddrinfo, freeaddrinfo and their associated struct and
constants.

  In addition, it declared inet_ntop and inet_pton (protected by their
respective HAVE_*). inet_pton isn't used in owfs, but inet_ntop is. And indeed,
that function will be defined in getaddrinfo.c when inet_ntop isn't available on
the system...

  OK, so I should rework the patch so that the rpc/netdb.h part of the include
is moved inside the #ifndef HAVE_GETADDRINFO chunk.

  Unless of course we decide that a system-supplied getaddrinfo (and inet_ntop)
is required, and remove the compat stuff completely. If that is preferred, I can
make a patch for it.

  Thanks,

  Regards,
  Arnout

--
Arnout Vandecappelle      arnout dot vandecappelle at essensium dot com
Senior Embedded Software Architect . . . . . . +32-478-010353 (mobile)
Essensium, Mind division . . . . . . . . . . . . . . http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium . . . . . BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] compat.h: only include compat_netdb.h if needed

Matthias Urlichs-3
On 10.03.2016 09:38, Arnout Vandecappelle wrote:
>   Unless of course we decide that a system-supplied getaddrinfo (and inet_ntop)
> is required, and remove the compat stuff completely. If that is preferred, I can
> make a patch for it.

I would think that any system you would want to run OWFS on, these days,
has native support for this.

Thus, IMHO we should drop it.

--
-- Matthias


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] compat.h: only include compat_netdb.h if needed

Arnout Vandecappelle (Essensium/Mind)


On 03/15/16 04:30, Matthias Urlichs wrote:
> On 10.03.2016 09:38, Arnout Vandecappelle wrote:
>>    Unless of course we decide that a system-supplied getaddrinfo (and inet_ntop)
>> is required, and remove the compat stuff completely. If that is preferred, I can
>> make a patch for it.
>
> I would think that any system you would want to run OWFS on, these days,
> has native support for this.
>
> Thus, IMHO we should drop it.

  Patch sent.

  Regards,
  Arnout

--
Arnout Vandecappelle      arnout dot vandecappelle at essensium dot com
Senior Embedded Software Architect . . . . . . +32-478-010353 (mobile)
Essensium, Mind division . . . . . . . . . . . . . . http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium . . . . . BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] compat.h: only include compat_netdb.h if needed

Arnout Vandecappelle (Essensium/Mind)


On 03/16/16 00:00, Arnout Vandecappelle wrote:

>
>
> On 03/15/16 04:30, Matthias Urlichs wrote:
>> On 10.03.2016 09:38, Arnout Vandecappelle wrote:
>>>     Unless of course we decide that a system-supplied getaddrinfo (and inet_ntop)
>>> is required, and remove the compat stuff completely. If that is preferred, I can
>>> make a patch for it.
>>
>> I would think that any system you would want to run OWFS on, these days,
>> has native support for this.
>>
>> Thus, IMHO we should drop it.
>
>    Patch sent.

  It seems that the patch was too large to send it to the mailing list (removing
5 files, that's a long patch...). Is there another way I can send it? I could
also use --irreversible-delete to make the patch smaller.

  Regards,
  Arnout

--
Arnout Vandecappelle      arnout dot vandecappelle at essensium dot com
Senior Embedded Software Architect . . . . . . +32-478-010353 (mobile)
Essensium, Mind division . . . . . . . . . . . . . . http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium . . . . . BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] compat.h: only include compat_netdb.h if needed

Johan Ström-3

On 16/03/16 21:02, Arnout Vandecappelle wrote:

>
> On 03/16/16 00:00, Arnout Vandecappelle wrote:
>>
>> On 03/15/16 04:30, Matthias Urlichs wrote:
>>> On 10.03.2016 09:38, Arnout Vandecappelle wrote:
>>>>      Unless of course we decide that a system-supplied getaddrinfo (and inet_ntop)
>>>> is required, and remove the compat stuff completely. If that is preferred, I can
>>>> make a patch for it.
>>> I would think that any system you would want to run OWFS on, these days,
>>> has native support for this.
>>>
>>> Thus, IMHO we should drop it.
>>     Patch sent.
>    It seems that the patch was too large to send it to the mailing list (removing
> 5 files, that's a long patch...). Is there another way I can send it? I could
> also use --irreversible-delete to make the patch smaller.
>
Cut out the contents of the files which are removed, and describe that
in plain text instead.

Johan

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] compat.h: only include compat_netdb.h if needed

Gregg Levine
In reply to this post by Arnout Vandecappelle (Essensium/Mind)
Hello!
Can you compress the patch? Either use Bzip2 or even ordinary Zip? Or
even our old friend Gzip. There's a peculiar 40K limit on attaching
files to this list.

Oh and how big was it originally?
-----
Gregg C Levine [hidden email]
"This signature fought the Time Wars, time and again."


On Wed, Mar 16, 2016 at 4:02 PM, Arnout Vandecappelle <[hidden email]> wrote:

>
>
> On 03/16/16 00:00, Arnout Vandecappelle wrote:
>>
>>
>> On 03/15/16 04:30, Matthias Urlichs wrote:
>>> On 10.03.2016 09:38, Arnout Vandecappelle wrote:
>>>>     Unless of course we decide that a system-supplied getaddrinfo (and inet_ntop)
>>>> is required, and remove the compat stuff completely. If that is preferred, I can
>>>> make a patch for it.
>>>
>>> I would think that any system you would want to run OWFS on, these days,
>>> has native support for this.
>>>
>>> Thus, IMHO we should drop it.
>>
>>    Patch sent.
>
>   It seems that the patch was too large to send it to the mailing list (removing
> 5 files, that's a long patch...). Is there another way I can send it? I could
> also use --irreversible-delete to make the patch smaller.
>
>   Regards,
>   Arnout
>
> --
> Arnout Vandecappelle      arnout dot vandecappelle at essensium dot com
> Senior Embedded Software Architect . . . . . . +32-478-010353 (mobile)
> Essensium, Mind division . . . . . . . . . . . . . . http://www.mind.be
> G.Geenslaan 9, 3001 Leuven, Belgium . . . . . BE 872 984 063 RPR Leuven
> LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
> GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
>
>
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
> _______________________________________________
> Owfs-developers mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/owfs-developers

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] compat.h: only include compat_netdb.h if needed

Roland Franke

Hello,

you can look a the following link by buildroot, where the packed owfs is now also include
for an build with it. There is the patch already active:

https://git.busybox.net/buildroot/tree/package/owfs/0002-compat.h-only-include-compat_netdb.h-if-needed.patch

Best regards,

Roland

Gregg Levine <[hidden email]> hat am 17. März 2016 um 05:06 geschrieben:


Hello!
Can you compress the patch? Either use Bzip2 or even ordinary Zip? Or
even our old friend Gzip. There's a peculiar 40K limit on attaching
files to this list.

Oh and how big was it originally?
-----
Gregg C Levine [hidden email]
"This signature fought the Time Wars, time and again."


On Wed, Mar 16, 2016 at 4:02 PM, Arnout Vandecappelle <[hidden email]> wrote:

On 03/16/16 00:00, Arnout Vandecappelle wrote:

>>>>
>> On 03/15/16 04:30, Matthias Urlichs wrote:
>>> On 10.03.2016 09:38, Arnout Vandecappelle wrote:
>>>> Unless of course we decide that a system-supplied getaddrinfo (and inet_ntop)
>>>> is required, and remove the compat stuff completely. If that is preferred, I can
>>>> make a patch for it.
>>>
>>> I would think that any system you would want to run OWFS on, these days,
>>> has native support for this.
>>>
>>> Thus, IMHO we should drop it.
>>
>> Patch sent.

It seems that the patch was too large to send it to the mailing list (removing
5 files, that's a long patch...). Is there another way I can send it? I could
also use --irreversible-delete to make the patch smaller.

Regards,
Arnout

--
Arnout Vandecappelle arnout dot vandecappelle at essensium dot com
Senior Embedded Software Architect . . . . . . +32-478-010353 (mobile)
Essensium, Mind division . . . . . . . . . . . . . . http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium . . . . . BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] compat.h: only include compat_netdb.h if needed

Johan Ström-3
On 17/03/16 07:46, [hidden email] wrote:

Hello,

you can look a the following link by buildroot, where the packed owfs is now also include
for an build with it. There is the patch already active:

https://git.busybox.net/buildroot/tree/package/owfs/0002-compat.h-only-include-compat_netdb.h-if-needed.patch

Best regards,

Roland

Hi,

thanks for the patch. Now applied to master!

Regards
Johan

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers