dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/support dir.c,1.15,1.16


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/support dir.c,1.15,1.16
Date: Sat, 10 May 2003 02:56:13 -0400

Update of /cvsroot/dotgnu-pnet/pnet/support
In directory subversions:/tmp/cvs-serv13192/support

Modified Files:
        dir.c 
Log Message:


Work around a broken definition of "struct dirent" on Solaris systems.


Index: dir.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/dir.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** dir.c       24 Apr 2003 06:00:43 -0000      1.15
--- dir.c       10 May 2003 06:56:11 -0000      1.16
***************
*** 2,6 ****
   * dir.c - Directory Related Functions
   *
!  * Copyright (C) 2001, 2002  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
--- 2,6 ----
   * dir.c - Directory Related Functions
   *
!  * Copyright (C) 2001, 2002, 2003  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
***************
*** 198,201 ****
--- 198,209 ----
  
  /*
+  * Determine if the "struct dirent" definition is broken.
+  * Broken means that "d_name" is declared with a size of 1.
+  */
+ #if defined(__sun__)
+ #define       BROKEN_DIRENT   1
+ #endif
+ 
+ /*
   * Define the ILDirEnt type.
   */
***************
*** 205,208 ****
--- 213,219 ----
        struct dirent *dptr;
        struct dirent de;
+ #ifdef BROKEN_DIRENT
+       char name[256];
+ #endif
  };
  
***************
*** 265,269 ****
  #ifdef HAVE_DIRENT_H
      
! #ifdef HAVE_READDIR_R
        ILDirEnt *result = NULL;
  
--- 276,280 ----
  #ifdef HAVE_DIRENT_H
      
! #if defined(HAVE_READDIR_R) && !defined(BROKEN_DIRENT)
        ILDirEnt *result = NULL;
  
***************
*** 305,308 ****
--- 316,322 ----
                allocatedResult->dptr = &(allocatedResult->de);
                ILMemCpy(&(allocatedResult->de), result, sizeof(struct dirent));
+ #if defined(BROKEN_DIRENT)
+               strcpy(allocatedResult->de.d_name, result->d_name);
+ #endif
                GetDirEntryType(directory, allocatedResult);
        }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]