if (size < BLOCKSIZE)
size = BLOCKSIZE;
- status = full_read (STDIN_FILENO, cursor, size);
+ status = safe_read (STDIN_FILENO, cursor, size);
if (status <= 0)
break;
}
init_sparsearray ();
clear_buffer (buffer);
- while (count = full_read (file, buffer, sizeof buffer), count != 0)
+ while (count = safe_read (file, buffer, sizeof buffer), count != 0)
{
/* Realloc the scratch area as necessary. FIXME: should reallocate
only at beginning of a new instance of non-zero data. */
#if 0
if (amount_read)
{
- count = full_read (file, start->buffer + amount_read,
+ count = safe_read (file, start->buffer + amount_read,
BLOCKSIZE - amount_read);
bufsize -= BLOCKSIZE - amount_read;
amount_read = 0;
#endif
/* Store the data. */
- count = full_read (file, start->buffer, BLOCKSIZE);
+ count = safe_read (file, start->buffer, BLOCKSIZE);
if (count < 0)
{
char buf[UINTMAX_STRSIZE_BOUND];
char buffer[BLOCKSIZE];
clear_buffer (buffer);
- count = full_read (file, buffer, bufsize);
+ count = safe_read (file, buffer, bufsize);
memcpy (start->buffer, buffer, BLOCKSIZE);
}
if (f < 0)
count = bufsize;
else
- count = full_read (f, start->buffer, bufsize);
+ count = safe_read (f, start->buffer, bufsize);
if (count < 0)
{
char buf[UINTMAX_STRSIZE_BOUND];
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')
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)
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"));
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);
#define rmtread(Fd, Buffer, Length) \
(_isrmt (Fd) ? rmt_read__ (Fd - __REM_BIAS, Buffer, Length) \
- : full_read (Fd, Buffer, Length))
+ : safe_read (Fd, Buffer, Length))
#define rmtwrite(Fd, Buffer, Length) \
(_isrmt (Fd) ? rmt_write__ (Fd - __REM_BIAS, Buffer, Length) \
counter < COMMAND_BUFFER_SIZE;
counter++, cursor++)
{
- if (full_read (READ_SIDE (handle), cursor, 1) != 1)
+ if (safe_read (READ_SIDE (handle), cursor, 1) != 1)
{
_rmt_shutdown (handle, EIO);
return 0;
{
char character;
- while (full_read (READ_SIDE (handle), &character, 1) == 1)
+ while (safe_read (READ_SIDE (handle), &character, 1) == 1)
if (character == '\n')
break;
}
for (counter = 0; counter < status; counter += rlen, buffer += rlen)
{
- rlen = full_read (READ_SIDE (handle), buffer, status - counter);
+ rlen = safe_read (READ_SIDE (handle), buffer, status - counter);
if (rlen <= 0)
{
_rmt_shutdown (handle, EIO);
for (; status > 0; status -= counter, argument += counter)
{
- counter = full_read (READ_SIDE (handle),
+ counter = safe_read (READ_SIDE (handle),
argument, (size_t) status);
if (counter <= 0)
{
(size_t) (BLOCKSIZE - status));
}
- status = full_read (handle, start->buffer, buffer_size);
+ status = safe_read (handle, start->buffer, buffer_size);
if (status < 0)
{
char buf[UINTMAX_STRSIZE_BOUND];