Browse Source

Fix warnings in lua plugin build on linux

Serj Kalichev 11 years ago
parent
commit
397396080e
3 changed files with 5 additions and 3 deletions
  1. 2 1
      plugins/lua/lua_action.c
  2. 1 1
      plugins/lua/lua_init.c
  3. 2 1
      plugins/lua/plugin_init.c

+ 2 - 1
plugins/lua/lua_action.c

@@ -1,5 +1,6 @@
 #include <stdlib.h>
 #include <sys/wait.h>
+#include <unistd.h>
 
 #include <konf/buf.h>
 #include <lub/string.h>
@@ -27,7 +28,7 @@ CLISH_PLUGIN_SYM(clish_plugin_lua_action)
 	lua_State *L = clish_shell__get_udata(shell, LUA_UDATA);
 	konf_buf_t *buf;
 	pid_t childpid;
-	int res = 0, origstdout = -1, fd[2];
+	int res = 0, fd[2];
 
 	if (!script) /* Nothing to do */
 		return (0);

+ 1 - 1
plugins/lua/lua_init.c

@@ -6,7 +6,7 @@
 
 #include "private.h"
 
-extern char *scripts_path = NULL;
+char *scripts_path = NULL;
 
 static bool_t
 load_scripts(lua_State *L, char *path)

+ 2 - 1
plugins/lua/plugin_init.c

@@ -1,4 +1,6 @@
+#include <stdlib.h>
 #include <string.h>
+#include <ctype.h>
 
 #include "private.h"
 
@@ -8,7 +10,6 @@ static char * trim(char *str)
 	const char *first = str;
 	char *last = str + strlen(str) - 1;
 	char *new = NULL;
-	int i = 0;
 
 	while (first < last && isspace(*first))
 		++first;