From c05060fb9b94834b829f87c34d88319c00a64bbd Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 18 Oct 2017 17:41:45 +0800 Subject: [PATCH] ceph.in: do not panic at control+d in interactive mode Signed-off-by: Kefu Chai --- src/ceph.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ceph.in b/src/ceph.in index daec2993764..79bec56261d 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -539,7 +539,11 @@ def new_style_command(parsed_args, cmdargs, target, sigdict, inbuf, verbose): import readline # noqa while True: - interactive_input = read_input() + try: + interactive_input = read_input() + except EOFError: + # leave user an uncluttered prompt + return 0, '\n', '' if interactive_input is None: return 0, '', '' cmdargs = parse_cmdargs(shlex.split(interactive_input))[2]