Re: [Ipsec-tools-devel] [PATCH 4/6] Check for GLOB_TILDE
Brought to you by:
mit_warlord,
netbsd
From: Rainer W. <rwe...@mo...> - 2016-03-27 11:27:22
|
Jörg Krause <joe...@em...cks> writes: > Check for GLOB_TILDE > > GLOB_TILDE is a GNU extension and might not be available on some C > libraries. > This fixes build errors with the musl C library. > diff -purN ipsec-tools-0.8.2.orig/src/racoon/cftoken.c ipsec-tools- > 0.8.2/src/racoon/cftoken.c > --- ipsec-tools-0.8.2.orig/src/racoon/cftoken.c 2016-03-21 > 20:55:47.567083946 +0100 > +++ ipsec-tools-0.8.2/src/racoon/cftoken.c 2016-03-26 > 20:35:49.039542913 +0100 > @@ -4753,7 +4753,11 @@ yycf_switch_buffer(path) > return -1; > } > > +#ifdef GLOB_TILDE > if (glob(path, GLOB_TILDE, NULL, &incstack[incstackp].matches) > != 0 || > +#else > + if (glob(path, 0, NULL, &incstack[incstackp].matches) != 0 || > +#endif > incstack[incstackp].matches.gl_pathc == 0) { > plog(LLV_ERROR, LOCATION, NULL, > "glob found no matches for path \"%s\"\n", > path); This would be better done as #ifndef GLOB_TILDE #define GLOB_TILDE 0 #endif plus a comment explaining why this is needed. |