summaryrefslogtreecommitdiff
path: root/lib/texpect
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2020-01-15 12:40:38 +0100
committerJeremy Allison <jra@samba.org>2020-01-15 21:25:34 +0000
commit733f798074b76ed8b96272a29c8cb91eef7a7118 (patch)
tree480df8dac7ac6fd87155932cdadec8fff9bc74a8 /lib/texpect
parent4fabe1d1072147c609f2e8a2c86da04724564cb2 (diff)
downloadsamba-733f798074b76ed8b96272a29c8cb91eef7a7118.tar.gz
texpect: Avoid duplicate sys_write()
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/texpect')
-rw-r--r--lib/texpect/texpect.c19
-rw-r--r--lib/texpect/wscript2
2 files changed, 2 insertions, 19 deletions
diff --git a/lib/texpect/texpect.c b/lib/texpect/texpect.c
index 797f0a024b4..8c9431e366e 100644
--- a/lib/texpect/texpect.c
+++ b/lib/texpect/texpect.c
@@ -34,6 +34,7 @@
#include "replace.h"
#include "system/filesys.h"
#include "system/wait.h"
+#include "lib/util/sys_rw.h"
#ifdef HAVE_PTY_H
#include <pty.h>
@@ -176,24 +177,6 @@ static char *iscmd(const char *buf, const char *s)
return strdup(buf + len);
}
-/*******************************************************************
-A write wrapper that will deal with EINTR.
-********************************************************************/
-
-static ssize_t sys_write(int fd, const void *buf, size_t count)
-{
- ssize_t ret;
-
- do {
- ret = write(fd, buf, count);
-#if defined(EWOULDBLOCK)
- } while (ret == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
-#else
- } while (ret == -1 && (errno == EINTR || errno == EAGAIN));
-#endif
- return ret;
-}
-
static void parse_configuration(const char *fn)
{
struct command *c;
diff --git a/lib/texpect/wscript b/lib/texpect/wscript
index cf6071cd3c5..44f92a85136 100644
--- a/lib/texpect/wscript
+++ b/lib/texpect/wscript
@@ -6,5 +6,5 @@ def configure(conf):
def build(bld):
bld.SAMBA_BINARY('texpect',
'texpect.c',
- deps='popt util replace',
+ deps='popt util replace sys_rw',
for_selftest=True)