This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


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

[rfa] Include <dirent.h> et al; Was: Why does bfd/trad-core.c include <sys/dir.h>?


Ian Lance Taylor wrote:
> 
>    Date: Thu, 20 Apr 2000 16:47:41 +1000
>    From: Andrew Cagney <ac131313@cygnus.com>
> 
>    bfd/trad-core.c includes <sys/dir.h> (unconditionally).  My Solaris
>    2.5.1 machine tells me:
> 
>    /usr/include/sys/dir.h:41: warning: #warning "The information in this
>    file should be obtained from <dirent.h>"
>    /usr/include/sys/dir.h:42: warning: #warning "and is provided solely
>    (and temporarily) for backward compatibility."
> 
>    what really puzzles me is that I can't see any obvious <dirent.h>
>    dependant code in the file.
> 
> I believe that on some systems you must include <sys/dir.h> before
> including <sys/user.h>.  I'm not completly certain about that, though.
> 
> In any case, the fix is straightforward.  Copy the HAVE_DIRENT_H
> handling from hpux-core.c.

Patch attached.  Ok?

	Andrew

Tue May 30 15:39:04 2000  Andrew Cagney  <cagney@b1.cygnus.com>

	* trad-core.c: From hpux-core.c, include <dirent.h> or
 	<sys/ndir.h> when possible.

Index: bfd/trad-core.c
===================================================================
RCS file: /cvs/src/src/bfd/trad-core.c,v
retrieving revision 1.6
diff -p -r1.6 trad-core.c
*** trad-core.c	2000/05/08 06:57:39	1.6
--- trad-core.c	2000/05/30 06:12:41
*************** Foundation, Inc., 59 Temple Place - Suit
*** 25,31 ****
  #include "libaout.h"           /* BFD a.out internal data structures */
  
  #include <sys/param.h>
! #include <sys/dir.h>
  #include <signal.h>
  
  #include <sys/user.h>		/* After a.out.h  */
--- 25,43 ----
  #include "libaout.h"           /* BFD a.out internal data structures */
  
  #include <sys/param.h>
! #ifdef HAVE_DIRENT_H
! # include <dirent.h>
! #else
! # ifdef HAVE_SYS_NDIR_H
! #  include <sys/ndir.h>
! # endif
! # ifdef HAVE_SYS_DIR_H
! #  include <sys/dir.h>
! # endif
! # ifdef HAVE_NDIR_H
! #  include <ndir.h>
! # endif
! #endif
  #include <signal.h>
  
  #include <sys/user.h>		/* After a.out.h  */

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