From bbe7d80b6cc2cf11a443442e304776e57e293f98 Mon Sep 17 00:00:00 2001 From: Stephen Adams Date: Thu, 9 Nov 1995 15:16:48 +0000 Subject: [PATCH] Reverted previous changes. --- v7/src/microcode/uxio.c | 40 +++++----------------------------------- 1 file changed, 5 insertions(+), 35 deletions(-) diff --git a/v7/src/microcode/uxio.c b/v7/src/microcode/uxio.c index 14b13f958..cec81b446 100644 --- a/v7/src/microcode/uxio.c +++ b/v7/src/microcode/uxio.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: uxio.c,v 1.35 1995/11/09 06:53:59 adams Exp $ +$Id: uxio.c,v 1.36 1995/11/09 15:16:48 adams Exp $ Copyright (c) 1990-94 Massachusetts Institute of Technology @@ -242,46 +242,16 @@ size_t DEFUN (OS_channel_read_load_file, (channel, buffer, nbytes), Tchannel channel AND PTR buffer AND size_t nbytes) { - int scr; - size_t total = 0; - try_again: - scr = (UX_read ((CHANNEL_DESCRIPTOR (channel)), buffer, nbytes)); - if (scr < 0) { - printf("\nRead error %d", errno); - fflush(stdout); - return 0; - } - total += scr; - /* If the channel is a stream socket then data is delivered in dribs - and drabs so we have to keep trying until be get the data or an error. - */ - if (scr < nbytes && scr > 0) - { - buffer += scr; - nbytes -= scr; - goto try_again; - } - return total; + int scr = (UX_read ((CHANNEL_DESCRIPTOR (channel)), buffer, nbytes)); + return ((scr < 0) ? 0 : scr); } size_t DEFUN (OS_channel_write_dump_file, (channel, buffer, nbytes), Tchannel channel AND CONST PTR buffer AND size_t nbytes) { - int scr; - size_t total = 0; - try_again: - scr = (UX_write ((CHANNEL_DESCRIPTOR (channel)), buffer, nbytes)); - if (scr < 0) - return 0; - total += scr; - if (scr < nbytes && scr > 0) - { - buffer += scr; - nbytes -= scr; - goto try_again; - } - return total; + int scr = (UX_write ((CHANNEL_DESCRIPTOR (channel)), buffer, nbytes)); + return ((scr < 0) ? 0 : scr); } extern int EXFUN (strlen, (CONST char *)); -- 2.25.1