]> Dogcows Code - chaz/tar/commitdiff
Rename full_read to safe_read.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 5 Jul 1999 06:47:59 +0000 (06:47 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 5 Jul 1999 06:47:59 +0000 (06:47 +0000)
src/buffer.c
src/create.c
src/rmt.c
src/rmt.h
src/rtapelib.c
src/update.c

index 71843a436972b257970fe5e24d005adc2e4a8568..bdb467cd0e82bb5386216355b1d7f5e7de713779 100644 (file)
@@ -457,7 +457,7 @@ child_open_for_compress (void)
 
          if (size < BLOCKSIZE)
            size = BLOCKSIZE;
-         status = full_read (STDIN_FILENO, cursor, size);
+         status = safe_read (STDIN_FILENO, cursor, size);
          if (status <= 0)
            break;
        }
index ebc0442d19363c4407ecf12898f6b582cab9b8b4..a701c5a0807918b00238f146f966907a24d76d74 100644 (file)
@@ -540,7 +540,7 @@ deal_with_sparse (char *name, union block *header)
   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.  */
@@ -659,7 +659,7 @@ finish_sparse_file (int file, off_t *sizeleft, off_t fullsize, char *name)
 #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;
@@ -670,7 +670,7 @@ finish_sparse_file (int file, off_t *sizeleft, off_t fullsize, char *name)
 #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];
@@ -691,7 +691,7 @@ Read error at byte %s, reading %lu bytes, in file %s"),
        char buffer[BLOCKSIZE];
 
        clear_buffer (buffer);
-       count = full_read (file, buffer, bufsize);
+       count = safe_read (file, buffer, bufsize);
        memcpy (start->buffer, buffer, BLOCKSIZE);
       }
 
@@ -1197,7 +1197,7 @@ Removing leading `/' from absolute links")));
            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];
index b0ec6f98c3f7a5fd2d91b62639d829081b066b3d..f5e036cd6ceddae21e80b1b58aa126b6c6ad3633 100644 (file)
--- 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);
index 7b3c2982b6b8870ae242207cccbd9fcd98a49e78..b83f17ea99f7bdc53c233cb470528b5487fe4850 100644 (file)
--- a/src/rmt.h
+++ b/src/rmt.h
@@ -65,7 +65,7 @@ int rmt_ioctl__ PARAMS ((int, int, char *));
 
 #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) \
index 0afdec9716f05c4ff2cc6e8064a8430174407075..937fd70c605c862feb06ed20f4d856c37a4cb4f3 100644 (file)
@@ -144,7 +144,7 @@ get_status_string (int handle, char *command_buffer)
        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;
@@ -180,7 +180,7 @@ get_status_string (int handle, char *command_buffer)
       {
        char character;
 
-       while (full_read (READ_SIDE (handle), &character, 1) == 1)
+       while (safe_read (READ_SIDE (handle), &character, 1) == 1)
          if (character == '\n')
            break;
       }
@@ -527,7 +527,7 @@ rmt_read__ (int handle, char *buffer, size_t length)
 
   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);
@@ -661,7 +661,7 @@ rmt_ioctl__ (int handle, int operation, char *argument)
 
        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)
              {
index 98211eeeec63bf237585f93839babc7811265c9f..ea4dccf9a48efb75c88e0a566cac38e39e6054c9 100644 (file)
@@ -73,7 +73,7 @@ append_file (char *path)
                    (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];
This page took 0.031466 seconds and 4 git commands to generate.