database: use PATH_MAX of system
authorJosé Bollo <jose.bollo@iot.bzh>
Wed, 25 Oct 2017 09:29:20 +0000 (11:29 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Wed, 25 Oct 2017 09:29:20 +0000 (11:29 +0200)
Change-Id: I4b6567eb738c710109a2799f31575f83f5d852d1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
ll-database-binding/src/ll-database-binding.c

index 14b8b20..bbbba80 100644 (file)
@@ -23,7 +23,7 @@
 #include <pwd.h>
 #include <stdio.h>
 #include <string.h>
-#include <linux/limits.h>
+#include <limits.h>
 
 #include <json-c/json.h>
 #include <db.h>
 #define AFB_BINDING_VERSION 2
 #include <afb/afb-binding.h>
 
-#ifndef MAX_PATH
-#define MAX_PATH 1024
-#endif
-
 #define DBFILE         "ll-database-binding.db"
 
 #if !defined(TO_STRING_FLAGS)
@@ -92,7 +88,7 @@ static int get_database_path(char *buffer, size_t size)
  */
 static int ll_database_binding_init()
 {
-       char path[MAX_PATH];
+       char path[PATH_MAX];
        int ret;
 
        ret = get_database_path(path, sizeof path);