Bug#669059: webkit-1.8.0-2: FTBFS on hurd-*
Guillem Jover
guillem at debian.org
Mon Apr 23 05:54:05 UTC 2012
On Wed, 2012-04-18 at 08:35:23 +0200, Svante Signell wrote:
> Attached is an updated patch. This patch together with the one in
> #664810 would enable a successful build of webkit-1.8.0 for GNU/Hurd.
> --- a/Source/JavaScriptCore/wtf/gobject/GlibUtilities.cpp 2012-02-19 18:45:45.000000000 +0100
> +++ b/Source/JavaScriptCore/wtf/gobject/GlibUtilities.cpp 2012-04-18 08:18:39.000000000 +0200
> @@ -40,11 +42,21 @@
> #elif OS(UNIX)
> CString getCurrentExecutablePath()
> {
> - static char readLinkBuffer[PATH_MAX];
> - ssize_t result = readlink("/proc/curproc/file", readLinkBuffer, PATH_MAX);
> - if (result == -1)
> - return CString();
> - return CString(readLinkBuffer, result);
> + struct stat sb;
> + char *readLinkBuffer;
> + ssize_t result;
> + result = lstat("/proc/curproc/file", &sb);
> + readLinkBuffer = (char*)malloc(sb.st_size + 1);
> + if (readLinkBuffer == NULL)
> + return CString();
> + result = readlink("/proc/curproc/file", readLinkBuffer, sb.st_size + 1);
> + CString resultString;
> + if (result >= 0 && result < sb.st_size)
> + resultString = CString(readLinkBuffer, result);
> + else
> + resultString = CString();
> + free(readLinkBuffer);
> + return resultString;
> }
> #elif OS(WINDOWS)
> CString getCurrentExecutablePath()
As mentioned on the list this code will not work on the Hurd, a new
implementation needs to be done for OS(HURD) just before OS(UNIX),
because OS(UNIX) will match for the Hurd too. I gave a hint on how
this can be implemented on the list.
thanks,
guillem
More information about the Pkg-webkit-maintainers
mailing list