/* BFD library -- caching of file descriptors.
- Copyright 1990, 1991, 1992, 1993, 1994, 1996, 2000, 2001, 2002,
- 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1990-2015 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
#ifdef HAVE_GETRLIMIT
struct rlimit rlim;
if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
- && rlim.rlim_cur != RLIM_INFINITY)
+ && rlim.rlim_cur != (rlim_t) RLIM_INFINITY)
max = rlim.rlim_cur / 8;
else
#endif /* HAVE_GETRLIMIT */
if (nread == (file_ptr)-1)
{
bfd_set_error (bfd_error_system_call);
- return -1;
+ return nread;
}
#else
nread = fread (buf, 1, nbytes, f);
if (nread < nbytes && ferror (f))
{
bfd_set_error (bfd_error_system_call);
- return -1;
+ return nread;
}
#endif
if (nread < nbytes)