texpect: Do not depend on ccan
authorVolker Lendecke <vl@samba.org>
Thu, 12 Mar 2015 15:07:38 +0000 (15:07 +0000)
committerMichael Adam <obnox@samba.org>
Tue, 17 Mar 2015 10:30:52 +0000 (11:30 +0100)
texpect is the only remaining user of ccan code. Copy in the two routines

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
lib/texpect/texpect.c
lib/texpect/wscript
wscript
wscript_build

index 9256b5e..b553de8 100644 (file)
 #ifdef HAVE_ERR_H
 #include <err.h>
 #else
-#include <ccan/err/err.h>
+const char progname[] = "unknown program";
+
+static void err(int eval, const char *fmt, ...)
+{
+       int err_errno = errno;
+       va_list ap;
+
+       fprintf(stderr, "%s: ", progname);
+       va_start(ap, fmt);
+       vfprintf(stderr, fmt, ap);
+       va_end(ap);
+       fprintf(stderr, ": %s\n", strerror(err_errno));
+       exit(eval);
+}
+
+static void errx(int eval, const char *fmt, ...)
+{
+       va_list ap;
+
+       fprintf(stderr, "%s: ", progname);
+       va_start(ap, fmt);
+       vfprintf(stderr, fmt, ap);
+       va_end(ap);
+       fprintf(stderr, "\n");
+       exit(eval);
+}
+
 #endif
 
 struct command {
index 3dd4740..62a1d4d 100644 (file)
@@ -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 ccan', install=False)
+    bld.SAMBA_BINARY('texpect', 'texpect.c', deps='popt util', install=False)
diff --git a/wscript b/wscript
index 215bcaf..4e06576 100644 (file)
--- a/wscript
+++ b/wscript
@@ -151,7 +151,6 @@ def configure(conf):
     conf.RECURSE('source4/lib/tls')
     conf.RECURSE('source4/ntvfs/sysdep')
     conf.RECURSE('lib/util')
-    conf.RECURSE('lib/ccan')
     conf.RECURSE('lib/util/charset')
     conf.RECURSE('source4/auth')
     conf.RECURSE('nsswitch')
index 4e58063..877fa8b 100644 (file)
@@ -41,7 +41,6 @@ bld.RECURSE('lib/talloc')
 bld.RECURSE('lib/tevent')
 bld.RECURSE('lib/texpect')
 bld.RECURSE('lib/addns')
-bld.RECURSE('lib/ccan')
 bld.RECURSE('lib/ldb')
 bld.RECURSE('lib/param')
 bld.RECURSE('dynconfig')