From db868db05e03eb15513def0c0998884d37ecc3cf Mon Sep 17 00:00:00 2001 From: Keith Vetter Date: Sat, 3 Jun 1995 01:32:45 +0000 Subject: [PATCH] Low-level PC socket read/write didn't work git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5935 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/ChangeLog | 4 ++++ src/lib/krb5/os/net_read.c | 8 ++++++-- src/lib/krb5/os/net_write.c | 8 ++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 6eae4dd04..238672c61 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,7 @@ +Fri Jun 2 17:54:12 1995 Keith Vetter (keithv@fusion.com) + + * net_read.c, net_write.c: made to work with sockets. + Fri May 26 20:20:58 1995 Theodore Y. Ts'o (tytso@dcl) * configure.in, Makefile.in: Add support for building shared libraries. diff --git a/src/lib/krb5/os/net_read.c b/src/lib/krb5/os/net_read.c index 8cd5d15ef..b9e2b51be 100644 --- a/src/lib/krb5/os/net_read.c +++ b/src/lib/krb5/os/net_read.c @@ -23,6 +23,7 @@ */ #define NEED_LOWLEVEL_IO +#define NEED_SOCKETS #include "k5-int.h" /* @@ -45,9 +46,12 @@ krb5_net_read(context, fd, buf, len) int cc, len2 = 0; do { - cc = read(fd, buf, len); - if (cc < 0) + cc = SOCKET_READ(fd, buf, len); + if (cc < 0) { + if (SOCKET_ERRNO == SOCKET_EINTR) + continue; return(cc); /* errno is already set */ + } else if (cc == 0) { return(len2); } else { diff --git a/src/lib/krb5/os/net_write.c b/src/lib/krb5/os/net_write.c index f623d99df..4420b0bdc 100644 --- a/src/lib/krb5/os/net_write.c +++ b/src/lib/krb5/os/net_write.c @@ -23,6 +23,7 @@ */ #define NEED_LOWLEVEL_IO +#define NEED_SOCKETS #include "k5-int.h" /* @@ -44,9 +45,12 @@ krb5_net_write(context, fd, buf, len) int cc; register int wrlen = len; do { - cc = write(fd, buf, wrlen); - if (cc < 0) + cc = SOCKET_WRITE(fd, buf, wrlen); + if (cc < 0) { + if (SOCKET_ERRNO == SOCKET_EINTR) + continue; return(cc); + } else { buf += cc; wrlen -= cc; -- 2.26.2