This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [gfortran] patch for unlink on open files


Is there any particular reason you're doing the unpack early?
As opposed to one hunk

#if !HAVE_UNLINK_OPEN_FILE
  if (u->flags.status == STATUS_SCRATCH || status == CLOSE_DELETE)
    {
      char *path = (char *) alloca (u->file_len + 1);
      unpack_filename (path, u->file, u->file_len);
      unlink (path);
    }
#endif

The unlink has to be done after the call to close_unit(u), but the call frees the memory allocated to u. So, we need to unpack (that will store the filename), close the unit and then unlink.


FX


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