./libosso/debian r262: Fix compile on !linux (Fix thanks to Samuel)

Riku Voipio riku.voipio at iki.fi
Wed Feb 25 01:19:33 UTC 2009


------------------------------------------------------------
revno: 262
committer: Riku Voipio <riku.voipio at iki.fi>
branch nick: debian
timestamp: Sun 2009-01-04 19:30:15 +0200
message:
  Fix compile on !linux (Fix thanks to Samuel)
modified:
  src/osso-cp-plugin.c
-------------- next part --------------
=== modified file 'src/osso-cp-plugin.c'
--- a/src/osso-cp-plugin.c	2007-07-17 07:51:28 +0000
+++ b/src/osso-cp-plugin.c	2009-01-04 17:30:15 +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)
 {
+  void *handle = NULL;
+#ifdef PATH_MAX
   char libname[PATH_MAX];
-  void *handle = NULL;
 
   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-commits mailing list