summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2010-03-18 21:25:17 -0700
committerJames Peach <jpeach@apple.com>2010-06-21 08:58:10 -0700
commit12e15b0ac800a84d553ff82c4c61ccc8da9fd5fd (patch)
tree32859a0e30a471d26f2117439385d2c69f0168f8
parent6f96293406bfaff35e7588d0624842de145ff249 (diff)
downloadsamba-12e15b0ac800a84d553ff82c4c61ccc8da9fd5fd.tar.gz
samba-12e15b0ac800a84d553ff82c4c61ccc8da9fd5fd.tar.bz2
samba-12e15b0ac800a84d553ff82c4c61ccc8da9fd5fd.zip
smbtorture: Add history support to shell mode.
-rw-r--r--source4/lib/smbreadline/readline.m45
-rw-r--r--source4/torture/smbtorture.c9
2 files changed, 13 insertions, 1 deletions
diff --git a/source4/lib/smbreadline/readline.m4 b/source4/lib/smbreadline/readline.m4
index df154409ad..06d60caae1 100644
--- a/source4/lib/smbreadline/readline.m4
+++ b/source4/lib/smbreadline/readline.m4
@@ -78,6 +78,11 @@ AC_CHECK_LIB(readline, history_list,
[],
[$TERMLIBS])
+AC_CHECK_LIB(readline, add_history,
+ [AC_DEFINE(HAVE_ADD_HISTORY, 1, [Do we have add_history?])],
+ [],
+ [$TERMLIBS])
+
AC_MSG_CHECKING(whether to use extern readline)
if test x"$EXTERNAL_READLINE" = x"yes"; then
AC_MSG_RESULT(yes)
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c
index 848773ee8a..c1d32a769d 100644
--- a/source4/torture/smbtorture.c
+++ b/source4/torture/smbtorture.c
@@ -33,6 +33,9 @@
#include "auth/gensec/gensec.h"
#include "param/param.h"
+#if HAVE_READLINE_HISTORY_H
+#include <readline/history.h>
+#endif
static bool run_matching(struct torture_context *torture,
const char *prefix,
@@ -386,7 +389,11 @@ static void run_shell(struct torture_context *tctx)
if (cline == NULL)
return;
-
+
+#if HAVE_ADD_HISTORY
+ add_history(cline);
+#endif
+
ret = poptParseArgvString(cline, &argc, &argv);
if (ret != 0) {
fprintf(stderr, "Error parsing line\n");