From: Tobias Ulmer Date: Wed, 15 Feb 2017 14:59:55 +0000 (+0100) Subject: e2lib.ssh_remote_cmd: use callcmd_stdout_stderr() X-Git-Tag: e2factory-2.3.17~21 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=1404eb72dc87568698b45b9fc6054862a075439a;p=e2factory.git e2lib.ssh_remote_cmd: use callcmd_stdout_stderr() Signed-off-by: Tobias Ulmer --- diff --git a/generic/e2lib.lua b/generic/e2lib.lua index 9d2b2ee..89e30fc 100644 --- a/generic/e2lib.lua +++ b/generic/e2lib.lua @@ -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