1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

texpect: Avoid duplicate sys_write()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2020-01-15 12:40:38 +01:00 committed by Jeremy Allison
parent 4fabe1d107
commit 733f798074
2 changed files with 2 additions and 19 deletions

View File

@ -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;

View File

@ -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)