]> git.e2factory.org Git - e2factory.git/commitdiff
e2lib.ssh_remote_cmd: use callcmd_stdout_stderr()
authorTobias Ulmer <tu@emlix.com>
Wed, 15 Feb 2017 14:59:55 +0000 (15:59 +0100)
committerTobias Ulmer <tu@emlix.com>
Wed, 15 Feb 2017 14:59:55 +0000 (15:59 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/e2lib.lua

index 9d2b2ee7e84bb6aabac6aaf6e113f1b2c8334387..89e30fc576ea4042e4580429ed27f0ba0be52ad0 100644 (file)
@@ -1,7 +1,7 @@
 --- Utility and Helper Library
 -- @module generic.e2lib
 
--- Copyright (C) 2007-2016 emlix GmbH, see file AUTHORS
+-- Copyright (C) 2007-2017 emlix GmbH, see file AUTHORS
 --
 -- This file is part of e2factory, the emlix embedded build system.
 -- For more information see http://www.e2factory.org
@@ -2261,21 +2261,8 @@ function e2lib.ssh_remote_cmd(u, argv)
         table.insert(stderr, data)
     end
 
-    devnull, re = eio.fopen("/dev/null", "r")
-    if not devnull then
-        return false, re
-    end
-
-    fdctv = {
-        { dup = eio.STDIN, istype = "readfo", file = devnull },
-        { dup = eio.STDOUT, istype = "writefunc",
-            linebuffer = true, callfn = capture_stdout },
-        { dup = eio.STDERR, istype = "writefunc",
-            linebuffer = true, callfn = capture_stderr },
-    }
-
-    rc, re = e2lib.callcmd(command, fdctv)
-    eio.fclose(devnull)
+    rc, re = e2lib.callcmd_stdout_stderr(command, capture_stdout,
+        capture_stderr)
     if not rc then
         return false, re
     end