Avoid some blocking issues
authorSteven Barth <steven@midlink.org>
Fri, 12 Sep 2008 13:32:35 +0000 (13:32 +0000)
committerSteven Barth <steven@midlink.org>
Fri, 12 Sep 2008 13:32:35 +0000 (13:32 +0000)
libs/sgi-cgi/luasrc/sgi/cgi.lua
libs/sys/luasrc/sys.lua

index d36d43fb51973c3b50014a6b08ed97e37d09759d..f78adeaed60a8ade6874b965abcefd78dd8a7b44 100644 (file)
@@ -61,6 +61,7 @@ function run()
                        elseif id == 4 then
                                io.write(data1)
                        elseif id == 5 then
+                               io.close()
                                active = false
                        end
                end
index 02cea5e91d9664dd9547163722c559483074f51d..cf7fbc05f895c81a63e3e4288c08ecab6f71da4b 100644 (file)
@@ -67,7 +67,7 @@ function flash(image, kpattern)
        if kpattern then
                cmd = cmd .. "-k '" .. kpattern:gsub("'", "") .. "' "
        end
-       cmd = cmd .. "'" .. image:gsub("'", "") .. "' 2>/dev/null"
+       cmd = cmd .. "'" .. image:gsub("'", "") .. "' 2>/dev/null &"
 
        local fp = io.popen(cmd)
        fp:setvbuf("no")
@@ -78,18 +78,8 @@ function flash(image, kpattern)
                fp:close()
                return false, line
        else
-               line = fp:read()
-               if line == "Performing system upgrade..." then
-                       return true
-               end
-               
-               line = fp:read()
-               if line == "Performing system upgrade..." then
-                       return true
-               end
-               
                fp:close()
-               return false, line
+               return true
        end
 end