This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: fixincl problem




*** fixincl.c.ori       Fri Jan  5 08:28:58 2001
--- fixincl.c   Mon Jan 22 12:49:21 2001
***************
*** 364,377 ****
      res = (char*)mmap ((void*)NULL, data_map_size, PROT_READ,
                         MAP_PRIVATE, data_map_fd, 0);
    if (res == (char*)BAD_ADDR)
      {
        curr_data_mapped = BOOL_FALSE;
!       res = load_file_data ( fdopen (data_map_fd, "r"));
      }
- #else
-   curr_data_mapped = BOOL_FALSE;
-   res = load_file_data ( fdopen (data_map_fd, "r"));
- #endif
  
    return res;
  }
--- 364,376 ----
      res = (char*)mmap ((void*)NULL, data_map_size, PROT_READ,
                         MAP_PRIVATE, data_map_fd, 0);
    if (res == (char*)BAD_ADDR)
+ #endif
      {
+       FILE* fp = fdopen (data_map_fd, "r");
        curr_data_mapped = BOOL_FALSE;
!       res = load_file_data (fp);
!       fclose (fp);
      }
  
    return res;
  }
*** fixlib.c.ori        Sat Dec  2 11:46:32 2000
--- fixlib.c    Mon Jan 22 12:49:58 2001
***************
*** 39,44 ****
--- 39,47 ----
    int    space_left = -1;  /* allow for terminating NUL */
    size_t space_used = 0;
  
+   if (fp == (FILE*)NULL)
+     return pz_data;
+ 
    do
      {
        size_t  size_read;
***************
*** 62,68 ****
                  fprintf (stderr, "error %d (%s) reading input\n", err,
                           xstrerror (err));
                free ((void *) pz_data);
-               fclose (fp);
                return (char *) NULL;
              }
          }
--- 62,67 ----
***************
*** 73,79 ****
  
    pz_data = xrealloc ((void*)pz_data, space_used+1 );
    pz_data[ space_used ] = NUL;
-   fclose (fp);
  
    return pz_data;
  }
--- 72,77 ----

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]