diff lib-src/gnuslib.c @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents ec9a17fef872
children 360340f9fd5f
line wrap: on
line diff
--- a/lib-src/gnuslib.c	Mon Aug 13 09:00:04 2007 +0200
+++ b/lib-src/gnuslib.c	Mon Aug 13 09:02:59 2007 +0200
@@ -33,7 +33,6 @@
 static char rcsid [] = "!Header: gnuslib.c,v 2.4 95/02/16 11:57:37 arup alpha !";
 #endif
 
-#include <errno.h>
 #include "gnuserv.h"
 
 #ifdef SYSV_IPC
@@ -217,29 +216,6 @@
   }; /* while */ 
 #endif
 } /* send_string */
-
-/*
-  read_line -- read a \n terminated line from a socket
-*/
-int read_line(s,dest)
-     int s;
-     char *dest;
-{
-  char *index = NULL;
-  int length;
-  int offset=0;
-  char buffer[GSERV_BUFSZ+1];
-
-  while ((length=read(s,buffer+offset,1)>0) && buffer[offset]!='\n'
-	 && buffer[offset] != EOT_CHR) {
-    offset += length;
-    if (offset >= GSERV_BUFSZ) 
-      break;
-  }
-  buffer[offset] = '\0';
-  strcpy(dest,buffer);
-  return 1;
-} /* read_line */
 #endif /* INTERNET_DOMAIN_SOCKETS || UNIX_DOMAIN_SOCKETS */
 
 
@@ -429,14 +405,11 @@
     add_newline = (buffer[length-1] != '\n');
   }; /* while */
 #else
-  while ((length = read(s,buffer,GSERV_BUFSZ)) > 0 ||
-      (length == -1 && errno == EINTR)) {
-    if (length) {
-      buffer[length] = '\0';
-      if (echo) {
-	fputs(buffer,stdout);
-	add_newline = (buffer[length-1] != '\n');
-      }; /* if */
+  while ((length = read(s,buffer,GSERV_BUFSZ)) > 0) {
+    buffer[length] = '\0';
+    if (echo) {
+      fputs(buffer,stdout);
+      add_newline = (buffer[length-1] != '\n');
     }; /* if */
   }; /* while */
 #endif