Re: gnutls26 will be a blocker
On Fri, 2011-09-02 at 10:57 +0200, Samuel Thibault wrote:
> The gnutls26 FTBFS is becoming a blocker for libgcrypt, and thus
> probably a lot other packages.
> Can somebody have a look?
The simplest solution is to do:
--- ./gnutls26-2.12.7.orig/lib/pakchois/pakchois.c 2011-04-08
15:40:25.000000000 +0200
+++ ./gnutls26-2.12.7/lib/pakchois/pakchois.c 2011-09-02
12:08:58.000000000 +0200
@@ -54,6 +54,10 @@
#endif
#include "pakchois.h"
+#if !defined(PATH_MAX)
+#define PATH_MAX 4096
+#endif
+
struct provider
{
dev_t dev;
(like the Arch Hurd people do)
These constructs are already in ltmain.sh:
# Generated from ltmain.m4sh.
#if defined(PATH_MAX)
# define LT_PATHMAX PATH_MAX
#elif defined(MAXPATHLEN)
# define LT_PATHMAX MAXPATHLEN
#else
# define LT_PATHMAX 1024
#endif
Otherwise would this be OK?
--- ./gnutls26-2.12.7.orig/lib/pakchois/pakchois.c 2011-04-08
15:40:25.000000000 +0200
+++ ./gnutls26-2.12.7/lib/pakchois/pakchois.c 2011-09-02
12:27:37.000000000 +0200
@@ -204,9 +204,10 @@
for (i = 0; suffix_prefixes[i][0]; i++)
{
- char path[PATH_MAX];
+ char *path = NULL;
+ char *ret = NULL;
- snprintf (path, sizeof path, "%s/%s%s%s", dir,
+ asprintf (&path, "%s/%s%s%s", dir,
suffix_prefixes[i][0], hint,
suffix_prefixes[i][1]);
if (stat (path, &st) < 0)
@@ -215,7 +216,9 @@
*dev = st.st_dev;
*ino = st.st_ino;
- return strdup (path);
+ ret = strdup (path);
+ free (path);
+ return ret;
}
}
Reply to: