mirror of
https://github.com/ceph/ceph
synced 2026-08-01 22:45:39 +00:00
tools/rados: do not close stdin after put/append from '-'
do_put()/do_append() set fd to STDIN_FILENO for '-', but cleanup guarded close() on STDOUT_FILENO (always true), closing stdin. Guard on STDIN_FILENO instead. Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn>
This commit is contained in:
parent
cc1f41c8d2
commit
ef0b9f339f
@ -649,7 +649,7 @@ static int do_put(IoCtx& io_ctx,
|
||||
}
|
||||
ret = 0;
|
||||
out:
|
||||
if (fd != STDOUT_FILENO)
|
||||
if (fd != STDIN_FILENO)
|
||||
VOID_TEMP_FAILURE_RETRY(close(fd));
|
||||
return ret;
|
||||
}
|
||||
@ -684,7 +684,7 @@ static int do_append(IoCtx& io_ctx,
|
||||
}
|
||||
ret = 0;
|
||||
out:
|
||||
if (fd != STDOUT_FILENO)
|
||||
if (fd != STDIN_FILENO)
|
||||
VOID_TEMP_FAILURE_RETRY(close(fd));
|
||||
return ret;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user