Low-level PC socket read/write didn't work
authorKeith Vetter <keithv@fusion.com>
Sat, 3 Jun 1995 01:32:45 +0000 (01:32 +0000)
committerKeith Vetter <keithv@fusion.com>
Sat, 3 Jun 1995 01:32:45 +0000 (01:32 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5935 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/ChangeLog
src/lib/krb5/os/net_read.c
src/lib/krb5/os/net_write.c

index 6eae4dd0447a2f9cb7d547b11cc52f797bd6d1ae..238672c61ddece359f955c050950735d81574c86 100644 (file)
@@ -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.
index 8cd5d15ef48b04c9c4baec4ff2ae9275bc63c16c..b9e2b51bea87acbdc821bf93a4655cf31c9d4429 100644 (file)
@@ -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 {
index f623d99df14131e9860acd470790e2577374abfe..4420b0bdc534006fa12a92b50ae66dcf0ada0b7c 100644 (file)
@@ -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;