From ec52694fc6419dfea611188b2bd75c8127799aa5 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Thu, 9 Oct 2014 14:34:02 +0200 Subject: [PATCH 1/5] lib/texpect: portability fix, include signal.h Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison (cherry picked from commit ccb0d9d6169594e8dd1c8935c9dfec51ee7125c4) --- lib/texpect/texpect.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/texpect/texpect.c b/lib/texpect/texpect.c index c1a6a99..ac88979 100644 --- a/lib/texpect/texpect.c +++ b/lib/texpect/texpect.c @@ -62,6 +62,7 @@ #include #include #include +#include struct command { enum { CMD_EXPECT = 0, CMD_SEND, CMD_PASSWORD } type; -- 2.1.0 From 2842698a7dde3d9bd1d2ceb4d3e1e7c44a848e37 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 29 Oct 2014 11:48:59 +0100 Subject: [PATCH 2/5] lib/texpect: make the code more portable by using "replace.h" and "system/wait.h" Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison (cherry picked from commit 0f0148e020b6f85447f26de17c2b0b002bcdf498) --- lib/texpect/texpect.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/lib/texpect/texpect.c b/lib/texpect/texpect.c index ac88979..2ce33a2 100644 --- a/lib/texpect/texpect.c +++ b/lib/texpect/texpect.c @@ -31,20 +31,10 @@ * SUCH DAMAGE. */ -#include "config.h" +#include "replace.h" +#include "system/filesys.h" +#include "system/wait.h" -#ifndef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_WAIT_H -#include -#endif -#include -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif #ifdef HAVE_PTY_H #include #endif @@ -60,9 +50,7 @@ #endif /* STREAMPTY */ #include -#include #include -#include struct command { enum { CMD_EXPECT = 0, CMD_SEND, CMD_PASSWORD } type; -- 2.1.0 From 8e2a49debc8ce0ac0bc8001e3c5608ad4ed028a5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 26 Sep 2014 09:06:59 +0200 Subject: [PATCH 3/5] lib/texpect: fix compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Metzmacher Reviewed-by: Günther Deschner Reviewed-by: Jeremy Allison (cherry picked from commit e27a23e6aa27ae2a9b6ae2e2a2560943157aaa5c) --- lib/texpect/texpect.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/texpect/texpect.c b/lib/texpect/texpect.c index 2ce33a2..d788081 100644 --- a/lib/texpect/texpect.c +++ b/lib/texpect/texpect.c @@ -358,8 +358,9 @@ int main(int argc, const char **argv) pid_t pid; poptContext pc; const char *instruction_file; + const char **args; const char *program; - char* const *program_args; + char * const *program_args; pc = poptGetContext("texpect", argc, @@ -377,7 +378,8 @@ int main(int argc, const char **argv) } instruction_file = poptGetArg(pc); - program_args = poptGetArgs(pc); + args = poptGetArgs(pc); + program_args = (char * const *)discard_const_p(char *, args); program = program_args[0]; if (opt_verbose) { -- 2.1.0 From 3a8ed39a29a58adae4e9ff4378158d6407af8268 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 10 Dec 2014 12:23:04 +0000 Subject: [PATCH 4/5] lib/texpect: prefer bsd/libutil.h if available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Guenther Deschner Autobuild-User(master): Günther Deschner Autobuild-Date(master): Thu Dec 18 16:31:48 CET 2014 on sn-devel-104 (cherry picked from commit 0da7295fbc34170385d2b6bd165685aa092ab0ec) --- lib/texpect/texpect.c | 4 +++- lib/texpect/wscript | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/texpect/texpect.c b/lib/texpect/texpect.c index d788081..75a32f4 100644 --- a/lib/texpect/texpect.c +++ b/lib/texpect/texpect.c @@ -41,7 +41,9 @@ #ifdef HAVE_UTIL_H #include #endif -#ifdef HAVE_LIBUTIL_H +#ifdef HAVE_BSD_LIBUTIL_H +#include +#elif defined HAVE_LIBUTIL_H #include #endif diff --git a/lib/texpect/wscript b/lib/texpect/wscript index 4163ca1..62a1d4d 100644 --- a/lib/texpect/wscript +++ b/lib/texpect/wscript @@ -1,7 +1,7 @@ #!/usr/bin/env python def configure(conf): - conf.CHECK_FUNCS_IN('openpty', 'util', checklibc=True, headers='pty.h util.h libutil.h') + conf.CHECK_FUNCS_IN('openpty', 'util', checklibc=True, headers='pty.h util.h bsd/libutil.h libutil.h') def build(bld): bld.SAMBA_BINARY('texpect', 'texpect.c', deps='popt util', install=False) -- 2.1.0 From e125e05eefb24d60ae38dba5ee5e3ba401812e61 Mon Sep 17 00:00:00 2001 From: Tom Schulz Date: Fri, 13 Feb 2015 13:47:14 -0800 Subject: [PATCH 5/5] lib: texpect. Fix the build on Solaris. Bug 11092 - texpect requires routines err and errx https://bugzilla.samba.org/show_bug.cgi?id=11092 Signed-off-by: Tom Schulz Reviewed-by: Jeremy Allison Reviewed-by: Andreas Schneider Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Tue Feb 17 18:09:52 CET 2015 on sn-devel-104 (cherry picked from commit 4bbfc54d09d813d1fb827de5855ce40e8eab1095) --- lib/texpect/texpect.c | 5 +++++ lib/texpect/wscript | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/texpect/texpect.c b/lib/texpect/texpect.c index 75a32f4..9256b5e 100644 --- a/lib/texpect/texpect.c +++ b/lib/texpect/texpect.c @@ -52,7 +52,12 @@ #endif /* STREAMPTY */ #include + +#ifdef HAVE_ERR_H #include +#else +#include +#endif struct command { enum { CMD_EXPECT = 0, CMD_SEND, CMD_PASSWORD } type; diff --git a/lib/texpect/wscript b/lib/texpect/wscript index 62a1d4d..3dd4740 100644 --- a/lib/texpect/wscript +++ b/lib/texpect/wscript @@ -4,4 +4,4 @@ def configure(conf): conf.CHECK_FUNCS_IN('openpty', 'util', checklibc=True, headers='pty.h util.h bsd/libutil.h libutil.h') def build(bld): - bld.SAMBA_BINARY('texpect', 'texpect.c', deps='popt util', install=False) + bld.SAMBA_BINARY('texpect', 'texpect.c', deps='popt util ccan', install=False) -- 2.1.0