daily update
[deliverable/binutils-gdb.git] / bfd / cache.c
index c4becf8e32f974e4017526f0f8c07faf26452d1c..4e5ef2e3b4036b831352953fcd477a0757be4941 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD library -- caching of file descriptors.
-   Copyright 1990, 91, 92, 93, 94, 95, 1996, 2000
+   Copyright 1990, 1991, 1992, 1993, 1994, 1996, 2000, 2001
    Free Software Foundation, Inc.
    Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
 
@@ -311,7 +311,7 @@ bfd_open_file (abfd)
          if (stat (abfd->filename, &s) == 0 && s.st_size != 0)
            unlink (abfd->filename);
 #endif
-         abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WB);
+         abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WUB);
          abfd->opened_once = true;
        }
       break;
@@ -364,7 +364,9 @@ bfd_cache_lookup_worker (abfd)
     {
       if (bfd_open_file (abfd) == NULL)
        return NULL;
-      if (fseek ((FILE *) abfd->iostream, abfd->where, SEEK_SET) != 0)
+      if (abfd->where != (unsigned long) abfd->where)
+       return NULL;
+      if (fseek ((FILE *) abfd->iostream, (long) abfd->where, SEEK_SET) != 0)
        return NULL;
     }
 
This page took 0.030948 seconds and 4 git commands to generate.