summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source/client/client.c13
-rw-r--r--source/lib/readline.c13
2 files changed, 3 insertions, 23 deletions
diff --git a/source/client/client.c b/source/client/client.c
index dc5e0f5359d..d794f8fe53d 100644
--- a/source/client/client.c
+++ b/source/client/client.c
@@ -4342,8 +4342,6 @@ cleanup:
}
}
-static bool finished;
-
/****************************************************************************
Make sure we swallow keepalives during idle time.
****************************************************************************/
@@ -4390,8 +4388,6 @@ static void readline_callback(void)
DEBUG(0, ("Read from server failed, maybe it closed "
"the connection\n"));
- finished = true;
- smb_readline_done();
if (NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE)) {
set_smb_read_error(&cli->smb_rw_error,
SMB_READ_EOF);
@@ -4420,12 +4416,7 @@ static void readline_callback(void)
{
unsigned char garbage[16];
memset(garbage, 0xf0, sizeof(garbage));
- if (!cli_echo(cli, 1, garbage, sizeof(garbage))) {
- DEBUG(0, ("SMBecho failed. Maybe server has closed "
- "the connection\n"));
- smb_readline_done();
- finished = true;
- }
+ cli_echo(cli, 1, garbage, sizeof(garbage));
}
}
@@ -4437,7 +4428,7 @@ static int process_stdin(void)
{
int rc = 0;
- while (!finished) {
+ while (1) {
TALLOC_CTX *frame = talloc_stackframe();
char *tok = NULL;
char *the_prompt = NULL;
diff --git a/source/lib/readline.c b/source/lib/readline.c
index fd57799b578..254f55c86a1 100644
--- a/source/lib/readline.c
+++ b/source/lib/readline.c
@@ -45,16 +45,6 @@
# define RL_COMPLETION_CAST
#endif /* HAVE_NEW_LIBREADLINE */
-static bool smb_rl_done;
-
-void smb_readline_done(void)
-{
- smb_rl_done = true;
-#if HAVE_LIBREADLINE
- rl_done = 1;
-#endif
-}
-
/****************************************************************************
Display the prompt and wait for input. Call callback() regularly
****************************************************************************/
@@ -79,7 +69,7 @@ static char *smb_readline_replacement(const char *prompt, void (*callback)(void)
return NULL;
}
- while (!smb_rl_done) {
+ while (1) {
timeout.tv_sec = 5;
timeout.tv_usec = 0;
@@ -97,7 +87,6 @@ static char *smb_readline_replacement(const char *prompt, void (*callback)(void)
callback();
}
}
- return NULL;
}
/****************************************************************************