Bug#508520: libosso: FTBFS on non-linux systems

Samuel Thibault samuel.thibault at ens-lyon.org
Thu Dec 11 23:39:23 UTC 2008


Package: libosso
Severity: important
Tags: patch

Hello,

libosso includes linux/limits.h, and thus of course FTBFS on non-linux
systems.  In addition to that, it unconditionnaly uses PATH_MAX, while
that is not defined on systems which don't have such limit.  The
attached patch just makes it use POSIX-compliant limits.h instead and
handle systems without a PATH_MAX limitation.

Samuel

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.27 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

-- 
Samuel
 >bah moi j'aime bien le flash et je cherche plus a comprendre
 >crosoft. Ca plante : je reinstalle
 Ca à le mérite de créer des emplois jeunes : "réinstalleur de crosoft"
 -+- BD in NPC : Bill Gates au secours de l'emploi -+-
-------------- next part --------------
--- src/osso-cp-plugin.c.orig	2008-12-11 23:25:18.000000000 +0000
+++ src/osso-cp-plugin.c	2008-12-11 23:31:54.781172000 +0000
@@ -25,7 +25,7 @@
 #include "osso-internal.h"
 #include "osso-cp-plugin.h"
 #include "osso-log.h"
-#include <linux/limits.h>
+#include <limits.h>
 #include <errno.h>
 
 /* hildon-control-panel RPC */
@@ -86,14 +86,20 @@
 static void *
 try_plugin (osso_context_t *osso, const char *dir, const char *file)
 {
-  char libname[PATH_MAX];
   void *handle = NULL;
+#ifdef PATH_MAX
+  char libname[PATH_MAX];
 
   if (snprintf (libname, PATH_MAX, "%s/%s", dir, file) >= PATH_MAX)
     {
       ULOG_ERR_F("PATH_MAX exceeded");
       return NULL;
     }
+#else
+  char libname[strlen(dir) + 1 + strlen(file) + 1];
+
+  sprintf (libname, "%s/%s", dir, file);
+#endif
 
   LOCK_OR_RETURN(osso->mutex, NULL);
 


More information about the pkg-maemo-maintainers mailing list