diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2020-10-27 20:29:21 +0100 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-11-05 09:11:30 -0700 |
commit | 6eec4b04a2d12e6efe7744ff1221597b15c9b2ed (patch) | |
tree | d93e351313f26c0b67beff69a818ad1abf2465f6 /arch/sandbox/cpu/os.c | |
parent | 35b7ca768f7d826b77d5d3d6ccd6b1b8ed21f186 (diff) |
sandbox: eth-raw: do not close the console input
When the sandbox eth-raw device host_lo is removed this leads to closing
the console input.
Do not call close(0).
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/sandbox/cpu/os.c')
-rw-r--r-- | arch/sandbox/cpu/os.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index e7ec892bdf0..c461fb0db0e 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c @@ -86,7 +86,10 @@ int os_open(const char *pathname, int os_flags) int os_close(int fd) { - return close(fd); + /* Do not close the console input */ + if (fd) + return close(fd); + return -1; } int os_unlink(const char *pathname) |