[Pkg-utopia-maintainers] Bug#550800: Bug#550800: policykit-1: FTBFS on hurd-i386
Samuel Thibault
sthibault at debian.org
Tue Oct 13 23:54:52 UTC 2009
Hello,
Michael Biebl, le Wed 14 Oct 2009 00:27:51 +0200, a écrit :
> I applied your patch in 0.94-3 but this seems to cause build failures on ia64
> [1]. Would you mind looking at that? Otherwise I will have to revert the patch.
Oops, sorry, here is a fixed patch.
Samuel
-------------- next part --------------
Description: policykit-1 currently FTBFS on hurd-i386 because of unconditional use of
PATH_MAX, which hurd-i386 doesn't define since it doesn't have such
arbitrary limitation. The attached patch fixes it by just using
glibc's get_current_dir_name() extension when available.
Author: Samuel Thibault <sthibault at debian.org>
Bug: http://bugs.freedesktop.org/show_bug.cgi?id=24495
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550800
Index: policykit-1-0.94/src/examples/frobnicate.c
===================================================================
--- policykit-1-0.94.orig/src/examples/frobnicate.c 2009-08-12 15:56:47.000000000 +0200
+++ policykit-1-0.94/src/examples/frobnicate.c 2009-10-14 01:52:10.000000000 +0200
@@ -19,8 +19,10 @@
* Author: David Zeuthen <davidz at redhat.com>
*/
+#define _GNU_SOURCE
#include <glib.h>
#include <unistd.h>
+#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
@@ -31,13 +33,21 @@
gchar **env;
guint n;
int ret;
+#ifdef __GLIBC__
+ gchar *cwd = NULL;
+#else
gchar cwd[PATH_MAX];
+#endif
ret = 1;
args = NULL;
env = NULL;
+#ifdef __GLIBC__
+ if ((cwd = get_current_dir_name ()))
+#else
if (getcwd (cwd, sizeof cwd) == NULL)
+#endif
{
g_printerr ("Error getting cwd: %s", g_strerror (errno));
goto out;
@@ -62,6 +72,9 @@
out:
+#ifdef __GLIBC__
+ free (cwd);
+#endif
g_free (args);
g_strfreev (env);
More information about the Pkg-utopia-maintainers
mailing list