Browse Source

Provide an error message and end ACTION processing in case pipe() returns -1

Stanislav Galabov 11 years ago
parent
commit
a5c2367036
1 changed files with 4 additions and 1 deletions
  1. 4 1
      plugins/lua/lua_action.c

+ 4 - 1
plugins/lua/lua_action.c

@@ -36,7 +36,10 @@ CLISH_PLUGIN_SYM(clish_plugin_lua_action)
 	if (!out) /* Handle trivial case */
 		return exec_action(L, script);
 
-	pipe(fd);
+	if (pipe(fd) == -1) {
+		perror("pipe");
+		return -1;
+	}
 
 	if ((childpid = fork()) == -1) {
 		perror("fork");