--- losbflib.c.orig	Sun Jan 14 19:57:19 2007
+++ losbflib.c	Thu May 30 20:47:02 2013
@@ -13,6 +13,8 @@
  *
  */
 
+#include <sys/param.h>
+
 #include <ctype.h>
 #include <stddef.h>
 #include <stdio.h>
@@ -673,9 +675,9 @@ lua_osbf_changedir (lua_State * L)
 static int
 lua_osbf_getdir (lua_State * L)
 {
-  char cur_dir[MAX_DIR_SIZE + 1];
+  char cur_dir[MAXPATHLEN];
 
-  if (getcwd (cur_dir, MAX_DIR_SIZE) != NULL)
+  if (getcwd (cur_dir, MAXPATHLEN) != NULL)
     {
       lua_pushstring (L, cur_dir);
       return 1;
@@ -743,7 +745,7 @@ dir_gc (lua_State * L)
 
 /**********************************************************/
 
-static const struct luaL_reg osbf[] = {
+static const struct luaL_Reg osbf[] = {
   {"create_db", lua_osbf_createdb},
   {"remove_db", lua_osbf_removedb},
   {"config", lua_osbf_config},
