X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Frmt.c;h=f5e036cd6ceddae21e80b1b58aa126b6c6ad3633;hb=d46735235be2b3bcaf2e580d86f321130cd78e94;hp=b0ec6f98c3f7a5fd2d91b62639d829081b066b3d;hpb=bb9f6be7c177125f008655f8663a10f8b20494a4;p=chaz%2Ftar diff --git a/src/rmt.c b/src/rmt.c index b0ec6f9..f5e036c 100644 --- a/src/rmt.c +++ b/src/rmt.c @@ -128,7 +128,7 @@ get_string (char *string) for (counter = 0; counter < STRING_SIZE; counter++) { - if (full_read (STDIN_FILENO, string + counter, 1) != 1) + if (safe_read (STDIN_FILENO, string + counter, 1) != 1) exit (EXIT_SUCCESS); if (string[counter] == '\n') @@ -210,7 +210,7 @@ main (int argc, char *const *argv) top: errno = 0; /* FIXME: errno should be read-only */ status = 0; - if (full_read (STDIN_FILENO, &command, 1) != 1) + if (safe_read (STDIN_FILENO, &command, 1) != 1) exit (EXIT_SUCCESS); switch (command) @@ -330,8 +330,8 @@ top: prepare_record_buffer (size); for (counter = 0; counter < size; counter += status) { - status = full_read (STDIN_FILENO, &record_buffer[counter], - size - counter); + status = safe_read (STDIN_FILENO, &record_buffer[counter], + size - counter); if (status <= 0) { DEBUG (_("rmtd: Premature eof\n")); @@ -356,7 +356,7 @@ top: size = atol (count_string); prepare_record_buffer (size); - status = full_read (tape, record_buffer, size); + status = safe_read (tape, record_buffer, size); if (status < 0) goto ioerror; sprintf (reply_buffer, "A%ld\n", status);