summaryrefslogtreecommitdiff
path: root/src/modules/exec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/exec.lua')
-rw-r--r--src/modules/exec.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/modules/exec.lua b/src/modules/exec.lua
index 46f540e..e6a870c 100644
--- a/src/modules/exec.lua
+++ b/src/modules/exec.lua
@@ -1,15 +1,15 @@
--
-- gcsd
--
--- gcsd the generic command sequencer daemon can be used to serialize
+-- gcsd the generic command sequencer daemon can be used to serialize
-- commands sent over various paralell communication channels to a
-- single command output. It can be seen as a multiplexer for any
-- kind of communication between a single resource and various clients
-- which want to submit commands to it or query information from it.
--- gcsd is written in C and Lua. The goal is to provide an easy to
+-- gcsd is written in C and Lua. The goal is to provide an easy to
-- understand high level API based on Lua which can be used to
-- implement the business logic of the so formed multiplexer daemon.
---
+--
--
-- Copyright (C) 2009-2010 Markus Grueneis <gimpf@spreadspace.org>
-- Christian Pointner <equinox@spreadspace.org>
@@ -65,7 +65,7 @@ function exec:new(config, runtype)
log.printf(log.ERROR, inst.name .. ": exec failed: %s", error)
return nil
end
-
+
log.printf(log.NOTICE, inst.name .. ": child spawned with pid %d", child.pid)
local in_handle = {}
@@ -73,7 +73,7 @@ function exec:new(config, runtype)
rawio.setnonblock(in_handle.fd)
in_handle.client_instance = nil
in_handle.in_buffer = ""
- function in_handle:read()
+ function in_handle:read()
-- TODO: which size should we request??
local buffer, err = rawio.read(self.fd, 100)
if(buffer == nil) then
@@ -111,24 +111,24 @@ function exec:new(config, runtype)
end
return defines.OK
end
-
+
local client = {}
client.module_instance = inst
client.name = inst.name .. "#0"
client.pid = child.pid
function client:process_response() end
function client:process_timeout() end
- function client:get_read_handles()
+ function client:get_read_handles()
return { in_handle }
end
- function client:get_write_handles()
+ function client:get_write_handles()
if(out_handle.out_buffer ~= "") then
return { out_handle }
else
return {}
end
end
- function client:cleanup()
+ function client:cleanup()
util.kill(self.pid)
rawio.close(in_handle.fd)
rawio.close(out_handle.fd)