This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: new gfortran failures on darwin8


Jack Howarth wrote:
Jerry,
    The simple patch doesn't eliminate the new failures in
the gfortran testsuite.
                  Jack

On Wed, Jun 27, 2007 at 10:09:44PM -0700, Jerry DeLisle wrote:
Please try this simple patch first. If it does not work, let me know and I will work on Plan B. :) The patch is to unit.c in libgfortran/io/

I see that find_unit sets the private lock of the unit and requires unlock_unit. Why it works on some systems without the unlock I do not know.

Thanks for reporting and testing.


Please try this attached patch. It is against the same file, current trunk.


Thanks

Jerry
Index: io/unit.c
===================================================================
*** io/unit.c	(revision 126079)
--- io/unit.c	(working copy)
*************** update_position (gfc_unit *u)
*** 690,700 ****
     must free memory allocated for the filename string.  */
  
  char *
! filename_from_unit (int unit_number)
  {
    char *filename;
!   gfc_unit *u = NULL;
!   u = find_unit (unit_number);
    if (u != NULL)
      {
        filename = (char *) get_mem (u->file_len + 1);
--- 690,715 ----
     must free memory allocated for the filename string.  */
  
  char *
! filename_from_unit (int n)
  {
    char *filename;
!   gfc_unit *u;
!   int c;
! 
!   /* Find the unit.  */
!   u = unit_root;
!   while (u != NULL)
!     {
!       c = compare (n, u->unit_number);
!       if (c < 0)
! 	u = u->left;
!       if (c > 0)
! 	u = u->right;
!       if (c == 0)
! 	break;
!     }
! 
!   /* Get the filename.  */
    if (u != NULL)
      {
        filename = (char *) get_mem (u->file_len + 1);
*************** filename_from_unit (int unit_number)
*** 703,706 ****
      }
    else
      return (char *) NULL;
! }
\ No newline at end of file
--- 718,722 ----
      }
    else
      return (char *) NULL;
! }
! 

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